CN103955960B - Image viewpoint transformation method based on single input image - Google Patents

Image viewpoint transformation method based on single input image Download PDF

Info

Publication number
CN103955960B
CN103955960B CN201410107055.2A CN201410107055A CN103955960B CN 103955960 B CN103955960 B CN 103955960B CN 201410107055 A CN201410107055 A CN 201410107055A CN 103955960 B CN103955960 B CN 103955960B
Authority
CN
China
Prior art keywords
image
prime
point
cube structure
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201410107055.2A
Other languages
Chinese (zh)
Other versions
CN103955960A (en
Inventor
张贵平
郭延文
蓝自立
汪粼波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201410107055.2A priority Critical patent/CN103955960B/en
Publication of CN103955960A publication Critical patent/CN103955960A/en
Application granted granted Critical
Publication of CN103955960B publication Critical patent/CN103955960B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

本发明公开了基于单幅输入图像的图像视点变换方法,包含以下步骤:步骤1,交互扣取图像中包含的方体结构以及标注图像中的特征线;步骤2,利用针孔相机成像原理结合方体物体的空间特性重建一个三维场景,在视点变换时,该三维场景可以完全模拟真实三维场景;步骤3,在不改变焦距的前提下,通过视点转换,将重建的三维场景重投影到新视点对应的像平面;步骤4,依据交互约束对图像进行带约束的Delaunay三角网格化;步骤5,使用步骤3重投影得到的场景主题结构约束作为变形驱动,利用求解能量方程的方法对步骤4形成的网格变形能量方程求解;步骤6,利用求解所得目标网格,将原图像中与之对应的网格纹理一一贴图过来生成目标图像。

The invention discloses an image viewpoint transformation method based on a single input image, which comprises the following steps: step 1, interactively deducting the cube structure contained in the image and marking the feature lines in the image; step 2, using the imaging principle of a pinhole camera to combine The spatial characteristics of cube objects reconstruct a 3D scene, which can completely simulate the real 3D scene when the viewpoint is changed; Step 3, without changing the focal length, reproject the reconstructed 3D scene to the new The image plane corresponding to the viewpoint; step 4, perform constrained Delaunay triangular meshing on the image according to the interaction constraints; step 5, use the scene theme structural constraints obtained by reprojection in step 3 as the deformation driver, and use the method of solving the energy equation to 4. Solve the grid deformation energy equation formed; step 6, use the target grid obtained from the solution to map the corresponding grid textures in the original image one by one to generate the target image.

Description

一种基于单幅输入图像的图像视点变换方法An Image Viewpoint Transformation Method Based on a Single Input Image

技术领域technical field

本发明涉及一种基于单幅输入图像的图像视点变换方法,属于计算机图像处理和多媒体信息技术处理领域。The invention relates to an image viewpoint transformation method based on a single input image, which belongs to the field of computer image processing and multimedia information technology processing.

背景技术Background technique

随着数码相机的硬件改善以及图像编辑软件的发展,人们可以更加容易地得到高质量的图像画面。但是大量摄影爱好者所拍摄的照片却往往由于视角的选取而造成整个画面的不自然。举例来说,摄影者可能把原本垂直于地面的建筑拍歪拍斜,使得拍摄效果不自然,如何校正这样主体结构倾斜的照片具有很好的应用价值。在这种情况下,人们开始研究图像视点转换问题。传统的方式是首先利用多张同一场景的图像进行配准,而后进行三维重建,再利用已有的三维结构在新视点下进行重投影而渲染得到新视点下的图像画面。这种方法的显著缺点是需要多张输入图像或需要很多的人为交互以进行三维场景的精确重建,对于稍微复杂的三维场景均不可行,因此该类方法的适用性和效率都很低,效果也欠佳。With the improvement of digital camera hardware and the development of image editing software, people can more easily obtain high-quality images. However, the photos taken by a large number of photographers are often unnatural due to the selection of the angle of view. For example, a photographer may take a picture of a building that was originally perpendicular to the ground, making the shooting effect unnatural. How to correct such a tilted photo of the main structure has a very good application value. In this case, people began to study the problem of image viewpoint conversion. The traditional method is to first use multiple images of the same scene for registration, then perform 3D reconstruction, and then use the existing 3D structure to reproject under the new viewpoint to render the image under the new viewpoint. The obvious disadvantage of this method is that it requires multiple input images or requires a lot of human interaction to accurately reconstruct the 3D scene, which is not feasible for a slightly complex 3D scene, so the applicability and efficiency of this type of method are very low, and the effect Also not good.

发明内容Contents of the invention

发明目的:本发明提供了一种基于单幅输入图像的图像视点变换方法,使得用户通过极少而且方便地交互与简单的计算即可得到视点变换后的图像。Purpose of the invention: The present invention provides an image viewpoint transformation method based on a single input image, so that the user can obtain the viewpoint-transformed image through minimal and convenient interaction and simple calculation.

技术方案:本发明公开了一种基于单幅输入图像的图像视点变换方法,主要包含以下步骤:Technical solution: The present invention discloses an image viewpoint transformation method based on a single input image, which mainly includes the following steps:

步骤1,图像交互:通过手动交互提取图像中的方体结构,具体通过标注方体的其中六个点所对应的图像投影像素点,记为(p0,p1,p2,p3,p4,p5),其中(p0,p1,p2,p3)对应的三维平面垂直于(p0,p1,p5,p4)对应的三维平面,p0p1对应的空间直线为两平面的交线,交互得到图像中的特征线,包括影响图像内容的特征线,水平和垂直约束线段以及指定图像边界线;Step 1, image interaction: extract the cube structure in the image through manual interaction, specifically by marking the image projection pixels corresponding to six points of the cube, denoted as (p 0 ,p 1 ,p 2 ,p 3 , p 4 ,p 5 ), where the three-dimensional plane corresponding to (p 0 ,p 1 ,p 2 ,p 3 ) is perpendicular to the three-dimensional plane corresponding to (p 0 ,p 1 ,p 5 ,p 4 ), and p 0 p 1 corresponds to The space straight line is the intersection line of two planes, and the feature lines in the image are obtained interactively, including feature lines that affect image content, horizontal and vertical constraint line segments, and specified image boundary lines;

步骤2,利用针孔相机成像原理结合方体结构物体的空间特性重建一个三维场景,在视点变换时,利用该场景结构模拟真实的三维场景结构,在假设三维场景中方体结构的其中一个顶点与其在图像上的像点重合的基础上,利用方体包含的几何约束,计算出(p0,p1,p2,p3,p4,p5)对应的三维场景中的方体空间点坐标(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T);Step 2: Reconstruct a 3D scene by using the imaging principle of the pinhole camera combined with the spatial characteristics of the cube structure object. When the viewpoint changes, the scene structure is used to simulate the real 3D scene structure. In the assumed 3D scene, one of the vertices of the cube structure and its On the basis of the coincidence of image points on the image, use the geometric constraints contained in the cube to calculate the corresponding cube space point in the 3D scene of (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) coordinates(P 0 T ,P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T );

步骤3,利用新视点下重投影步骤2计算得到的六个点的空间坐标对应的方体,来代表重建的三维场景:在以模拟场景中心所在的原点O为球心,以模拟场景中心到相机的距离|OF|为半径的球平面上定义一个新视点O',将重建的三维方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)重新投影到新视点对应的像平面;Step 3, use the cube corresponding to the spatial coordinates of the six points calculated in step 2 to reproject under the new viewpoint to represent the reconstructed 3D scene: take the origin O where the center of the simulated scene is located as the center of the sphere, and take the center of the simulated scene to A new viewpoint O' is defined on the spherical plane whose distance |OF| is the radius of the camera, and the reconstructed three-dimensional cube structure (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) is re-projected to the image plane corresponding to the new viewpoint;

步骤4,图像三角网格化:依据步骤1的交互结构,利用带约束的Delaunay三角化对图像进行三角网格化;Delaunay三角化的算法可参见“计算几何(第3版)伯格著,世界图书出版社2013-10-1出版,ISBN:9787510061776”;Step 4, image triangulation: According to the interactive structure of step 1, use the Delaunay triangulation with constraints to triangulate the image; the algorithm of Delaunay triangulation can be found in "Computational Geometry (3rd Edition) Berger, Published by World Book Publishing House on October 1, 2013, ISBN: 9787510061776”;

步骤5,网格参数化:利用保角映射以及各种特征保持约束原理建立网格参数化的方程,利用步骤4重投影得到的场景方体框架构建投影映射的硬约束,求解参数化能量方程,得到目标网格;Step 5, grid parameterization: use conformal mapping and various feature-preserving constraint principles to establish grid parameterization equations, use the scene cube frame obtained by re-projection in step 4 to construct hard constraints for projection mapping, and solve parametric energy equations , get the target grid;

步骤6,目标图像生成:依据步骤5求解得到的网格,将原图像中与目标网格相对应的网格纹理利用双线性插值方法一一贴图到对应的目标网格,生成目标图像。Step 6, target image generation: According to the grid obtained in step 5, the grid texture corresponding to the target grid in the original image is mapped to the corresponding target grid one by one by bilinear interpolation method to generate the target image.

步骤1中,通过手动交互得到图像隐含的占图像主体结构的方体结构以及特征线。In step 1, the hidden cube structure and feature lines of the image, which occupy the main structure of the image, are obtained through manual interaction.

步骤1包含如下步骤:Step 1 includes the following steps:

步骤11,所述单幅输入图像,其场景中隐含方体结构,手动交互提取图像中该方体结构的投影,用方体的其中六个点所对应的图像投影像素点(p0,p1,p2,p3,p4,p5)来表示该方体结构,其中(p0,p1,p2,p3)所对应的空间三维平面正交于(p0,p1,p5,p4)所对应的三维平面,p0p1所对应的空间直线为两平面的交线;Step 11, the single input image contains a cubic structure hidden in the scene, manually and interactively extract the projection of the cubic structure in the image, and use the image projection pixels corresponding to six points of the cube (p 0 , p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) to represent the cube structure, where (p 0 ,p 1 ,p 2 ,p 3 ) corresponds to a three-dimensional space plane orthogonal to (p 0 ,p 1 , p 5 , p 4 ) correspond to the three-dimensional plane, and the space line corresponding to p 0 p 1 is the intersection line of the two planes;

步骤12,根据步骤11得到的方体结构(p0,p1,p2,p3,p4,p5),将图像中方体结构(p0,p1,p2,p3,p4,p5)间包含的连线都标注为硬约束特征线,在这些硬约束特征线上均匀地提取三角网格顶点,具体方法如下:对一条特定硬约束特征线,从一端开始取点,沿直线方向每隔25个像素距离取该直线上的下一个点,直到直线的另一端,对于所有硬约束特征线上所取得的网格顶点,记为{vc1,vc2,...,vck},其中ck代表这里提取的网格定顶点总数;Step 12, according to the cube structure (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) obtained in step 11, convert the cube structure (p 0 ,p 1 ,p 2 ,p 3 ,p 4 , p 5 ) are marked as hard-constrained feature lines, and the triangular mesh vertices are uniformly extracted on these hard-constrained feature lines. The specific method is as follows: for a specific hard-constrained feature line, start from one end , take the next point on the line at intervals of 25 pixels along the direction of the line until the other end of the line. For the grid vertices obtained on all hard constraint feature lines, denote as {v c1 ,v c2 ,.. .,v ck }, where ck represents the total number of vertices extracted here;

步骤13,交互得到图像中的特征直线,包括影响图像内容的特征线,水平和垂直约束线段以及指定图像边界线,在这些线上均匀取点,具体方法如下:对一条特定特征线约束直线,从一端开始取点,沿直线方向每隔25个像素距离取该直线上的下一个点,直到直线的另一端;Step 13, interactively obtain the feature lines in the image, including feature lines that affect the content of the image, horizontal and vertical constraint line segments, and specified image boundary lines, and evenly take points on these lines. The specific method is as follows: constrain the line to a specific feature line, Take a point from one end, and take the next point on the line every 25 pixels along the line until the other end of the line;

步骤14,对于图像中的特征曲线,例如原本是圆形的太阳,依次在曲线上提取三角网格点,具体方法如下:从特征曲线的一端开始,顺着特征曲线伸长方向,以大约25个像素距离作为取点间隔,直到到达特征曲线的另一端。。Step 14, for the characteristic curve in the image, such as the original circular sun, extract the triangular grid points on the curve in turn, the specific method is as follows: start from one end of the characteristic curve, follow the elongation direction of the characteristic curve, and divide by about 25 pixel distance as the point interval until reaching the other end of the characteristic curve. .

步骤2中,利用针孔相机成像原理以及方体物体的空间几何结构建立模拟的三维方体结构模型。In step 2, a simulated three-dimensional cube structure model is established by using the imaging principle of the pinhole camera and the spatial geometry of the cube object.

步骤2具体包括以下步骤:Step 2 specifically includes the following steps:

步骤21,以图像中心为原点O(0,0,0),O到相机所在点F(0,0,f)为Z轴正向,图像平面的横轴和纵轴方向为XY方向建立三维世界坐标系,其中f为相机焦距,具体参照图3;Step 21, take the center of the image as the origin O(0,0,0), O to the camera point F(0,0,f) is the positive direction of the Z axis, and the horizontal and vertical axes of the image plane are the XY directions to establish a three-dimensional The world coordinate system, where f is the focal length of the camera, refer to Figure 3 for details;

步骤22,计算得到直线p0p3与直线p1p2的交点c1,直线p0p4与直线p1p5的交点c2,显然在三维空间中,直线Fc1与直线P0 TP3 T,P1 TP2 T相交于无穷远处,显然有Fc1平与直线P0 TP3 T,同样直线Fc2与直线P0 TP4 T,P1 TP5 T相交于无穷远处,显然有Fc2平与直线P0 TP4 T,依据P0 TP3 T⊥P0 TP5 T,得到故此求解得到焦距f;Step 22, calculate and obtain the intersection c 1 of the straight line p 0 p 3 and the straight line p 1 p 2 , the intersection c 2 of the straight line p 0 p 4 and the straight line p 1 p 5 , obviously in three-dimensional space, the straight line Fc 1 and the straight line P 0 T P 3 T , P 1 T P 2 T intersect at infinity, obviously there is Fc 1 flat and straight line P 0 T P 3 T , the same straight line Fc 2 and straight line P 0 T P 4 T , P 1 T P 5 T intersect at infinity, obviously there is Fc 2 flat and straight line P 0 T P 4 T , according to P 0 T P 3 T ⊥P 0 T P 5 T , we get Therefore, the solution obtains the focal length f;

步骤23,记真实场景中方体上对应于图像中方体结构(p0,p1,p2,p3,p4,p5)的六个点为(Q0,Q1,Q2,Q3,Q4,Q5),依据针孔成像模型有:k=0,1,...,5,其中代表向量之间的比例,同样的,对于模拟场景中的与(p0,p1,p2,p3,p4,p5)相对应的(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T),同样必须有k=0,1,...,5成立,其中rk代表向量之间的比例,固定r0的取值为1,利用求解出r1,r2,r3,r4,r5;当时,Pi与Qi完全重合,此时我们可以完全计算出真实场景中方体结构对应于(p0,p1,p2,p3,p4,p5)的真实坐标,否则有Pi TPj T//QiQj成立,既(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)构成的模型是(Q0,Q1,Q2,Q3,Q4,Q5)构成模型的一个缩放;Step 23, write down the six points on the cuboid in the real scene corresponding to the cuboid structure (p 0 , p 1 , p 2 , p 3 , p 4 , p 5 ) in the image as (Q 0 , Q 1 , Q 2 , Q 3 , Q 4 , Q 5 ), according to the pinhole imaging model: k=0,1,...,5, where representative vector and Similarly , for (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ), there must also be k=0,1,...,5 is established, where rk represents a vector and The ratio between, the value of fixed r 0 is 1, using and Solve r 1 , r 2 , r 3 , r 4 , r 5 ; when , P i and Q i are completely coincident, at this time we can completely calculate the real coordinates of the cube structure corresponding to (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) in the real scene, otherwise there is P i T P j T //Q i Q j is established, that is, the model formed by (P 0 T ,P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T ) is (Q 0 ,Q 1 , Q 2 , Q 3 , Q 4 , Q 5 ) constitute a scaling of the model;

步骤24,依据步骤23得到的比例r0,r1,r2,r3,r4,r5,计算出模拟场景中对应于方体结构(p0,p1,p2,p3,p4,p5)的方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T),设定P0 T与p0重合,定义场景中心为过场景中方体结构中顶点P0 T在主光轴上的投影点,此处恰好为原点O,即模拟场景中心落在原点上,对应于真实场景中Q0在主光轴上的投影点,真实场景中心OQStep 24, according to the ratios r 0 , r 1 , r 2 , r 3 , r 4 , r 5 obtained in step 23, calculate the corresponding cubic structure (p 0 , p 1 , p 2 , p 3 , p 4 , p 5 ) cube structure (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ), set P 0 T to coincide with p 0 , and define the center of the scene as Through the projection point of the vertex P 0 T on the main optical axis in the cube structure in the scene, here is exactly the origin O, that is, the center of the simulated scene falls on the origin, corresponding to the projection point of Q 0 on the main optical axis in the real scene , the real scene center O Q .

步骤3中,在新视点下重新投影模拟的三维方体结构。In step 3, the simulated 3D cube structure is reprojected under the new viewpoint.

步骤3具体包括以下步骤:Step 3 specifically includes the following steps:

步骤31,依据步骤24得到的方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)我们在以O为圆心|OF|为半径的球面上随机取一个新视点O',其中的夹角不超过45度,经过模拟场景中心O构造垂直于OO'的平面I',求得点(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)与O'的连线与平面I'的交点(p'0,p1',p'2,p'3,p'4,p'5),完成了模拟场景中方体结构在新视点下的投影;Step 31, according to the cubic structure (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) obtained in step 24, on the spherical surface with O as the center |OF| Randomly pick a new viewpoint O', where and The included angle does not exceed 45 degrees. After simulating the center O of the scene, a plane I' perpendicular to OO' is constructed to obtain the point (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) The intersection point (p' 0 ,p 1 ',p' 2 ,p' 3 ,p' 4 ,p' 5 ) of the connection line with O' and the plane I' completes the simulation of the cube structure in the simulation scene under the new viewpoint projection;

步骤32,将法向量与垂直向量(0,1,0)的叉乘得到单位向量x',将x'与叉乘得到单位向量y',在图像平面I'上以O为原点,向量x'方向为横坐标正向,向量y'方向为纵坐标正向建立图像二维坐标系,将i=0,1,2,...,5分别投影到向量x'、y'两个方向上,得到交点(p'0,p1',p'2,p'3,p'4,p'5)在图像平面I'上的二维坐标,记为(q0,q1,q2,q3,q4,q5),这样我们得到了原图像中方体结构上六个点在新视点下投影在目标图像上的二维坐标。Step 32, the normal vector Cross product with the vertical vector (0,1,0) to get the unit vector x', and x' with The cross product obtains the unit vector y'. On the image plane I', take O as the origin, the direction of the vector x' is the positive direction of the abscissa, and the direction of the vector y' is the positive direction of the ordinate to establish a two-dimensional image coordinate system. i=0,1,2,...,5 are respectively projected onto the two directions of vectors x' and y' to obtain intersection points (p' 0 ,p 1 ',p' 2 ,p' 3 ,p' 4 , The two-dimensional coordinates of p' 5 ) on the image plane I' are recorded as (q 0 , q 1 , q 2 , q 3 , q 4 , q 5 ), so we get six points on the cube structure in the original image 2D coordinates projected on the target image under the new viewpoint.

步骤4中,利用所提取的网格顶点对图像进行Delaunay三角化。In step 4, use the extracted mesh vertices to perform Delaunay triangulation on the image.

步骤4具体包括以下步骤:Step 4 specifically includes the following steps:

步骤41,在步骤1得到的特征网格点的基础上,对于图像的剩余区域随机均匀采点作为网格顶点;Step 41, on the basis of the feature grid points obtained in step 1, randomly and evenly pick points for the remaining regions of the image as grid vertices;

步骤42,在三角化的过程中,以步骤1交互的图像特征线,取同一特征线上相邻顶点连线作为三角网格边,利用带约束的Delaunay三角化对图像进行三角网格化,Delaunay三角化的算法可参见“计算几何(第3版)伯格著世界图书出版社2013-10-1出版,ISBN:9787510061776”。Step 42, in the process of triangulation, use the feature line of the image interactive in step 1, take the connection of adjacent vertices on the same feature line as the edge of the triangle mesh, and use the constrained Delaunay triangulation to triangulate the image, The algorithm of Delaunay triangulation can be found in "Computational Geometry (3rd Edition) published by Berg World Book Press on October 1, 2013, ISBN: 9787510061776".

步骤5中,构造图像变形的能量约束。In step 5, energy constraints for image deformation are constructed.

步骤5具体包括以下步骤:Step 5 specifically includes the following steps:

步骤51,利用步骤32计算出的(p0,p1,p2,p3,p4,p5)所对应的新视点下像平面上的像素点(q0,q1,q2,q3,q4,q5),利用计算得到点v'ci对应的点v'ci,其中vci为原始图像硬约束特征直线上的网格顶点,ps,pe为vci所在硬约束特征直线上的两个端点,qs,qe为分别为与ps,pe对应的点,即{vc1,vc2,...,vck}在新视点O'下被映射为{v'c1,v'c2,...,v'ck},记其对应的硬约束关系为FC(v'c1,v'c2,...,v'ck)=0,表明在图像变形映射时vi被映射到vi';Step 51 , use the pixel points ( q 0 , q 1 , q 2 , q 3 ,q 4 ,q 5 ), using Calculate the point v' ci corresponding to the point v' ci , where v ci is the grid vertex on the original image's hard-constrained feature line, p s , p e is the two endpoints on the hard-constrained feature line where v ci is located, q s , q e are points corresponding to p s and p e respectively, that is, {v c1 ,v c2 ,...,v ck } is mapped to {v' c1 ,v' c2 ,. ..,v' ck }, record its corresponding hard constraint relationship as F C (v' c1 ,v' c2 ,...,v' ck )=0, indicating that v i is mapped to v during image deformation mapping i ';

步骤52,定义形状约束:将二维三角网格仿射变换记为M:(x,y)→(x',y'),依据柯西‐黎曼(Cauchy–Riemann)方程有:Step 52, define shape constraints: record the affine transformation of the two-dimensional triangular mesh as M:(x,y)→(x',y'), according to the Cauchy-Riemann equation:

∂∂ Mm ∂∂ xx ++ ii ∂∂ Mm ∂∂ ythe y == 00

其中i为虚数单位,关于柯西‐黎曼方程,可参见“LSCM:Least squares conformalmaps for automatic texture atlas generation,ACM Transactions on Graphics,21(3):362‐372.”,映射M对应的雅克比矩阵具有如下形式:Where i is the imaginary unit. Regarding the Cauchy-Riemann equation, please refer to "LSCM: Least squares conformal maps for automatic texture atlas generation, ACM Transactions on Graphics, 21(3): 362-372." The Jacobian corresponding to the mapping M The matrix has the following form:

JJ == aa bb bb -- aa -- -- -- (( 11 ))

其中a,b取值任意,用以表示矩阵J中各元素间相等以及互为相反数的关系;Among them, the values of a and b are arbitrary, which are used to represent the relationship between the elements in the matrix J that are equal and opposite to each other;

对应原网格到目标网格的变换,我们采用放射变换;记原三角形为T(vti,vtj,vtk),vti,vtj,vtk为其三个顶点,其对应视点变换后待求解的变形三角形为T'(v'ti,v'tj,v'tk),v'ti,v'tj,v'tk为与vti,vtj,vtk一一对应的三个顶点,A=T'T-1是从T到T'的仿射变换矩阵,T-1具有如下形式:Corresponding to the transformation from the original grid to the target grid, we use radial transformation; record the original triangle as T(v ti ,v tj ,v tk ), v ti ,v tj ,v tk are its three vertices, and the corresponding viewpoint transformation The deformed triangle to be solved is T'(v' ti , v' tj , v' tk ), and v' ti , v' tj , v' tk are three corresponding to v ti , v tj , v tk Vertex, A=T'T -1 is an affine transformation matrix from T to T', T -1 has the following form:

TT -- 11 == aa 11 bb 11 dd 11 aa 22 bb 22 dd 22 aa 33 bb 33 dd 33 == xx titi xx tjtj xx tktk ythe y titi ythe y tjtj ythe y tktk zz titi zz tjtj zz tktk -- 11 -- -- -- (( 22 ))

其中,xti,xtj,xtk为点vti,vtj,vtk在图像上的横坐标,yti,ytj,ytk为点vti,vtj,vtk在图像上的纵坐标,zti,ztj,ztk为用于表示vti,vtj,vtk的竖坐标,这里统一取值为1;a1,a2,a3,b1,b2,b3,c1,c2,c3是矩阵T-1中各个元素的参数表示,值都为计算得到的常数,由式(1)和(2)得到保角映射的如下能量方程:Among them, x ti , x tj , x tk are the abscissa coordinates of points v ti , v tj , v tk on the image, y ti , y tj , y tk are the vertical coordinates of points v ti , v tj , v tk on the image Coordinates, z ti , z tj , z tk are the vertical coordinates used to represent v ti , v tj , v tk , where the uniform value is 1; a 1 , a 2 , a 3 , b 1 , b 2 , b 3 , c 1 , c 2 , and c 3 are the parameter representations of each element in the matrix T -1 , and the values are constants obtained from calculation. The following energy equation of the conformal mapping is obtained from formulas (1) and (2):

ETJ1=a1x'ti+a2x'tj+a3x'tk+(b1y'ti+b2y'tj+b3y'tk)(3)E TJ1 =a 1 x' ti +a 2 x' tj +a 3 x' tk +(b 1 y' ti +b 2 y' tj +b 3 y' tk ) (3)

ETJ2=b1x'ti+b2x'tj+b3x'tk-(a1y'ti+a2y'tj+a3y'tk)E TJ2 =b 1 x' ti +b 2 x' tj +b 3 x' tk -(a 1 y' ti +a 2 y' tj +a 3 y' tk )

其中x'ti,x'tj,x'tk分别为v'ti,v'tj,v'tk的横坐标值,y'ti,y'tj,y'tk分别为v'ti,v'tj,v'tk的纵坐标值,将它们联合在一起得到:Where x' ti , x' tj , x' tk are the abscissa values of v' ti , v' tj , v' tk respectively, y' ti , y' tj , y' tk are respectively v' ti , v' tj , the ordinate value of v' tk , combine them together to get:

EE. SS == ΣΣ TT (( EE. TJTJ 11 22 ++ EE. TJTJ 22 22 )) -- -- -- (( 44 ))

定义特征线约束:记(vi,vj,vk)为一条特征线上的连续三个点,保持之间的比例rlj以及旋转角度θlj,定义如下目标方程:Define feature line constraints: record (v i , v j , v k ) as three consecutive points on a feature line, keep and The ratio between r lj and the rotation angle θ lj , define the following objective equation:

EE. LL == ΣΣ (( vv lili ,, vv ljlj ,, vv lklk )) || || (( vv lklk ′′ -- vv ljlj ′′ )) -- rr ljlj RR ljlj (( vv ljlj ′′ -- vv lili ′′ )) || || 22 -- -- -- (( 55 ))

其中 R lj = cos θ lj - sin θ lj sin θ lj cos θ lj , in R lj = cos θ lj - sin θ lj sin θ lj cos θ lj ,

定义垂直约束:记垂直线段lv上的网格点记为{vlv1,vlv2,...,vlvm},垂直约束表示为:Define vertical constraints: record the grid points on the vertical line segment lv as {v lv1 ,v lv2 ,...,v lvm }, and the vertical constraints are expressed as:

EE. VV == ΣΣ lvlv ΣΣ nvnv == 11 lvmlvm (( xx nvnv ′′ -- xx lvlv 11 ′′ )) 22 -- -- -- (( 66 )) ,,

其中x'nv表示点v'nv横坐标,x'lv1表示点v'lv1横坐标。Among them, x' nv represents the abscissa of point v' nv , and x' lv1 represents the abscissa of point v' lv1 .

定义水平约束:记水平线段lh上的网格点记为{vlh1,vlh2,...,vlhm},垂直约束表示为: E H = Σ lh Σ nh = 1 lhm ( x nh ′ - x lh 1 ′ ) 2 - - - ( 7 ) , Define horizontal constraints: record the grid points on the horizontal line segment lh as {v lh1 ,v lh2 ,...,v lhm }, and the vertical constraints are expressed as: E. h = Σ lh Σ no = 1 lhm ( x no ′ - x lh 1 ′ ) 2 - - - ( 7 ) ,

其中y'nv表示点v'nv横坐标,yl'h1表示点v'lh1横坐标。Among them, y' nv represents the abscissa of point v' nv , and y l ' h1 represents the abscissa of point v' lh1 .

依据用户交互指定,将原始图像部分或全部边界指定为非硬性特征线约束,记(vbi,vbj,vbk)为边界特征线上的连续三个特征顶点,保持之间的比例rbj定义图像的边界约束EB如下;According to user interaction designation, part or all of the boundary of the original image is designated as a non-rigid feature line constraint, and (v bi , v bj , v bk ) are three consecutive feature vertices on the boundary feature line, keeping and The ratio between r bj defines the boundary constraints E B of the image as follows;

EE. BB == ΣΣ (( vv bibi ,, vv bjbj ,, vv bkbk )) || || (( vv bkbk ′′ -- vv bjbj ′′ )) -- rr bjbj (( vv bjbj ′′ -- vv bibi ′′ )) || || 22 -- -- -- (( 88 )) ,,

其中rbj之间的比例。where r bj is and ratio between.

步骤53,综合步骤51和步骤52,表示网格参数化的能量方程如下:Step 53, integrating step 51 and step 52, expresses the energy equation of grid parameterization as follows:

argmaxλSESLELVEVHEHBEB(9)argmaxλ S E SL E LV E VH E HB E B (9)

s.t.FC(v1',v'2,...,v'k)=0stF C (v 1 ',v' 2 ,...,v' k )=0

其中λSLVHB为各能量项对应的权值,在实际的运行过程中对于不同的图片参数有一定的调整,经过多组实验图片给出一组经验参数值如下:λS取1,λL与λB取100,λV和λH取10。Among them, λ S , λ L , λ V , λ H , and λ B are the weights corresponding to each energy item. In the actual operation process, there are certain adjustments for different picture parameters. After multiple sets of experimental pictures, a set of experience is given. The parameter values are as follows: λ S takes 1, λ L and λ B take 100, and λ V and λ H take 10.

步骤6中,利用网格贴图生成目标图像。In step 6, the target image is generated using the grid map.

步骤6具体包括以下步骤:Step 6 specifically includes the following steps:

步骤61,依据方程式(9),求解出与原图像中各个三角网格对应的目标三角网格,将原三角网格中的图片纹理采用双线性插值的方法贴图到对应的目标三角网格,形成目标图像。Step 61, according to equation (9), solve the target triangular grid corresponding to each triangular grid in the original image, and map the image texture in the original triangular grid to the corresponding target triangular grid by bilinear interpolation method , forming the target image.

有益效果:本发明包含以下优点:Beneficial effect: the present invention comprises the following advantages:

(1)能够处理只有单幅场景图的情况以及更为简单的操作流程,无需多幅场景图作为输入并且避免了复杂的图像配准操作。(1) It can handle the case of only a single scene graph and a simpler operation process, without requiring multiple scene graphs as input and avoiding complex image registration operations.

(2)较为少量、方便的用户交互。相比于采用纯手工来模拟视点变换的方法,本发明的方法交互工作量大大降低,只需手动交互标注出主体的方体结构以及少量特征线,保证了方法的易用性。(2) Relatively small and convenient user interaction. Compared with the method of manually simulating viewpoint transformation, the interactive workload of the method of the present invention is greatly reduced, and only the cube structure of the main body and a small number of feature lines need to be manually marked interactively, which ensures the ease of use of the method.

(3)效果的真实性。由于以单张实拍照片为输入,通过图像变形生成结果图像,结果图像效果佳,此外本发明支持用户手动标注需要保持形状的特征线,因此结果图像不容易出现凸显的变形瑕疵。(3) The authenticity of the effect. Since a single real photo is used as input and the resulting image is generated through image deformation, the resulting image has a good effect. In addition, the present invention supports the user to manually mark the feature lines that need to maintain the shape, so the resulting image is not prone to prominent deformation defects.

(4)快速的处理速度及鲁棒性。除去用户交互,本发明方法可以在0.1秒左右得到结果图像。(4) Fast processing speed and robustness. Excluding user interaction, the method of the present invention can obtain the result image in about 0.1 second.

附图说明Description of drawings

下面结合附图和具体实施方式对本发明做更进一步的具体说明,本发明上述和/或其他方面的优点将会变得更加清楚。The advantages of the above and/or other aspects of the present invention will become clearer as the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.

图1为本发明方法的基本流程图。Fig. 1 is the basic flowchart of the method of the present invention.

图2为本发明描述的对图像交互提取的隐含方体结构示意图。Fig. 2 is a schematic diagram of an implicit cube structure for image interactive extraction described in the present invention.

图3为本发明描述的模拟三维结构与真实三维重投影一致性示意图。Fig. 3 is a schematic diagram of the consistency between the simulated three-dimensional structure described in the present invention and the real three-dimensional reprojection.

图4为本发明方法实施的实例流程图。Fig. 4 is an example flowchart of the implementation of the method of the present invention.

图5为本发明方法结果与美国奥多比系统公司(Adobe Systems)Lightroom软件所实现的方法的比较效果图。Fig. 5 is a comparison effect diagram between the results of the method of the present invention and the method realized by Adobe Systems (Adobe Systems) Lightroom software.

图6为本发明方法模拟视域球观察图像场景的生成效果图。FIG. 6 is an effect diagram of the method of the present invention for simulating the observation of an image scene by a viewing sphere.

具体实施方式:detailed description:

本方法的流程如图1所示。首先交互扣取图像中包含的方体结构以及标注图像中的特征曲线;然后利用针孔相机成像原理以及方体物体的空间特性恢复模拟的三维结构;进而通过视点转换,将恢复的三维结构重投影到新视点对应的像平面;依据交互约束对图像进行三角网格化;使用步骤3重投影得到的结果作为变形驱动,利用求解能量方程的方法对网格进行参数化求解;最后通过纹理贴图插值生成目标图像。本发明可以在一定球形视域范围内对单张输入图像的物体进行三维模拟观测,形成连续实景仿真,具体可以参见图4实例流程图。The process flow of this method is shown in Figure 1 . First, the cube structure contained in the image and the characteristic curve in the marked image are interactively deducted; then the simulated 3D structure is restored by using the imaging principle of the pinhole camera and the spatial characteristics of the cube object; Project to the image plane corresponding to the new viewpoint; triangulate the image according to the interactive constraints; use the result obtained in step 3 reprojection as the deformation driver, and use the method of solving the energy equation to solve the grid parametrically; finally through the texture map Interpolate to generate the target image. The present invention can perform three-dimensional simulation observation on objects of a single input image within a certain range of spherical field of view to form a continuous real-scene simulation. For details, refer to the example flow chart in FIG. 4 .

具体地说,如图1所示,一种基于单幅输入图像的图像视点变换方法:Specifically, as shown in Figure 1, an image viewpoint transformation method based on a single input image:

步骤1,图像交互:通过手动交互提取图像中的方体结构,具体通过标注方体的其中六个点所对应的图像投影像素点(p0,p1,p2,p3,p4,p5),其中(p0,p1,p2,p3)对应的三维平面垂直于(p0,p1,p5,p4)对应的三维平面,p0p1为两平面的交线,具体如图2所示,交互得到图像中的特征线,包括影响图像内容的特征线,水平和垂直线段以及指定图像边界线;Step 1, image interaction: extract the cube structure in the image through manual interaction, specifically by marking the image projection pixels corresponding to six points of the cube (p 0 , p 1 , p 2 , p 3 , p 4 , p 5 ), where the three-dimensional plane corresponding to (p 0 , p 1 , p 2 , p 3 ) is perpendicular to the three-dimensional plane corresponding to (p 0 , p 1 , p 5 , p 4 ), and p 0 p 1 is the Intersection lines, as shown in Figure 2, interactively obtain feature lines in the image, including feature lines that affect image content, horizontal and vertical line segments, and specified image boundary lines;

步骤2,利用针孔相机成像原理结合方体结构物体的空间特性重建一个三维场景,在视点变换时,利用该场景结构模拟真实的三维场景结构,在假设三维场景中方体结构的其中一个顶点与其在图像上的像点重合的基础上,利用方体包含的几何约束,计算出(p0,p1,p2,p3,p4,p5)对应的三维场景中的方体空间点坐标(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T);Step 2: Reconstruct a 3D scene by using the imaging principle of the pinhole camera combined with the spatial characteristics of the cube structure object. When the viewpoint changes, the scene structure is used to simulate the real 3D scene structure. In the assumed 3D scene, one of the vertices of the cube structure and its On the basis of the coincidence of image points on the image, use the geometric constraints contained in the cube to calculate the corresponding cube space point in the 3D scene of (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) coordinates(P 0 T ,P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T );

步骤3,利用新视点下重投影步骤2计算得到的六个点的空间坐标对应的方体,来代表重建的三维场景:在以模拟场景中心,即原点O为球心,以模拟场景中心到相机的距离|OF|为半径的球平面上定义一个新视点O',将重建三维方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)重新投影到新视点对应的像平面;Step 3, use the cube corresponding to the spatial coordinates of the six points calculated in step 2 to represent the reconstructed 3D scene: take the center of the simulated scene, that is, the origin O as the center of the sphere, and take the center of the simulated scene to The camera distance |OF| defines a new viewpoint O' on a spherical plane with a radius, which will reconstruct a three-dimensional cube structure (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) Reproject to the image plane corresponding to the new viewpoint;

步骤4,图像三角网格化:依据步骤1的交互结构,利用带约束的Delaunay三角化对图像进行三角网格化;Delaunay三角化的算法可参见“计算几何(第3版)伯格著,世界图书出版社2013-10-1出版,ISBN:9787510061776”;Step 4, image triangulation: According to the interactive structure of step 1, use the Delaunay triangulation with constraints to triangulate the image; the algorithm of Delaunay triangulation can be found in "Computational Geometry (3rd Edition) Berger, Published by World Book Publishing House on October 1, 2013, ISBN: 9787510061776";

步骤5,网格参数化:利用保角映射原理以及各种特征保持约束建立网格参数化的方程,利用步骤4重投影得到的场景方体框架构建投影映射的硬约束,求解参数化能量方程,得到目标网格;Step 5, grid parameterization: use the principle of conformal mapping and various feature preservation constraints to establish grid parameterization equations, use the scene cube frame obtained by reprojection in step 4 to construct hard constraints for projection mapping, and solve the parameterized energy equation , get the target grid;

步骤6,目标图像生成:依据步骤5求解得到的网格,将原图像中与目标网格相对应的网格纹理利用双线性插值方法一一贴图到对应的目标网格,生成目标图像。Step 6, target image generation: According to the grid obtained in step 5, the grid texture corresponding to the target grid in the original image is mapped to the corresponding target grid one by one by bilinear interpolation method to generate the target image.

步骤1中,通过手动交互得到图像隐含的占图像主体结构的方体结构以及特征线。In step 1, the hidden cube structure and feature lines of the image, which occupy the main structure of the image, are obtained through manual interaction.

步骤1包含如下步骤:Step 1 includes the following steps:

步骤11,如图2所示,通过手动交互提取图像中隐含的方体结构的投影结构,我们一般选取这样的6个点(p0,p1,p2,p3,p4,p5),其对应于真实场景中方体上的6个点(Q0,Q1,Q2,Q3,Q4,Q5),其中(Q0,Q1,Q2,Q3)在同一个方体表面上,(Q0,Q1,Q3,Q4)同在一个方体表面上,且有Q0Q3//Q1Q2,Q0Q4//Q1Q5,Q0Q4⊥Q0Q1,Q0Q3⊥Q0Q1Step 11, as shown in Figure 2, extracts the projection structure of the hidden cube structure in the image through manual interaction. We generally select such six points (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ), which corresponds to 6 points (Q 0 , Q 1 , Q 2 , Q 3 , Q 4 , Q 5 ) on the cuboid in the real scene, where (Q 0 , Q 1 , Q 2 , Q 3 ) are in On the same cube surface, (Q 0 ,Q 1 ,Q 3 ,Q 4 ) are on the same cube surface, and there are Q 0 Q 3 //Q 1 Q 2 , Q 0 Q 4 //Q 1 Q 5 , Q 0 Q 4 ⊥Q 0 Q 1 , Q 0 Q 3 ⊥Q 0 Q 1 ;

步骤12,根据步骤11得到的方体结构(p0,p1,p2,p3,p4,p5),将图像中方体结构(p0,p1,p2,p3,p4,p5)间包含的连线都标注为硬约束特征线,在这些硬约束特征线上均匀地提取三角网格顶点,具体方法如下:对一条特定硬约束特征线,从一端开始取点,沿直线方向每隔25个像素距离取该直线上的下一个点,直到直线的另一端,对于所有硬约束特征线上所取得的网格顶点,记为{vc1,vc2,...,vck},其中ck代表提取的硬约束网格定顶点总数;Step 12, according to the cube structure (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) obtained in step 11, convert the cube structure (p 0 ,p 1 ,p 2 ,p 3 ,p 4 , p 5 ) are marked as hard-constrained feature lines, and the triangular mesh vertices are uniformly extracted on these hard-constrained feature lines. The specific method is as follows: for a specific hard-constrained feature line, start from one end , take the next point on the line at intervals of 25 pixels along the direction of the line until the other end of the line. For the grid vertices obtained on all hard constraint feature lines, denote as {v c1 ,v c2 ,.. .,v ck }, where ck represents the total number of vertices extracted from the hard-constrained mesh;

步骤13,交互得到图像中的特征直线,包括影响图像内容的特征线段,水平和垂直约束线段以及指定图像边界线,在这些线段上均匀取点,具体方法如下:对一条特定特征直线,我们从其一端开始取点,沿直线方向每隔25个像素距离取该直线上的下一个点,直到直线的另一端;Step 13, interactively obtain the feature lines in the image, including feature line segments that affect image content, horizontal and vertical constraint line segments, and specified image boundary lines, and evenly take points on these line segments. The specific method is as follows: For a specific feature line, we start from Points are taken from one end of the line, and the next point on the line is taken every 25 pixels along the line until the other end of the line;

步骤14,对于图像中的特征曲线,例如原本是圆形的太阳,依次在曲线上提取三角网格点,具体方法如下:从一条特征曲线的一端开始,顺着特征曲线伸长方向,以大约25个像素距离作为取点间隔,直到到达特征曲线的另一端。Step 14, for the characteristic curve in the image, such as the original circular sun, extract triangular grid points on the curve in turn, the specific method is as follows: start from one end of a characteristic curve, follow the elongation direction of the characteristic curve, and move by about The distance of 25 pixels is taken as the point interval until reaching the other end of the characteristic curve.

步骤2中,利用针孔相机成像原理以及方体物体的空间几何结构建立模拟的三维方体结构模型。In step 2, a simulated three-dimensional cube structure model is established by using the imaging principle of the pinhole camera and the spatial geometry of the cube object.

步骤2具体包括以下步骤:Step 2 specifically includes the following steps:

步骤21,以图像中心为原点O(0,0,0),O到相机所在点F(0,0,f)为Z轴正向,图像平面的横轴和纵轴方向为XY方向建立三维世界坐标系,其中f为相机焦距,具体参照图3;Step 21, take the center of the image as the origin O(0,0,0), O to the camera point F(0,0,f) is the positive direction of the Z axis, and the horizontal and vertical axes of the image plane are the XY directions to establish a three-dimensional The world coordinate system, where f is the focal length of the camera, refer to Figure 3 for details;

步骤22,计算得到直线p0p3与直线p1p2的交点c1,直线p0p4与直线p1p5的交点c2,显然在三维空间中,直线Fc1与直线P0 TP3 T,P1 TP2 T相交于无穷远处,显然有Fc1平与直线P0 TP3 T,同样直线Fc2与直线P0 TP4 T,P1 TP5 T相交于无穷远处,显然有Fc2平与直线P0 TP4 T,依据P0 TP3 T⊥P0 TP5 T,得到故此求解得到焦距f;Step 22, calculate and obtain the intersection c 1 of the straight line p 0 p 3 and the straight line p 1 p 2 , the intersection c 2 of the straight line p 0 p 4 and the straight line p 1 p 5 , obviously in three-dimensional space, the straight line Fc 1 and the straight line P 0 T P 3 T , P 1 T P 2 T intersect at infinity, obviously there is Fc 1 flat and straight line P 0 T P 3 T , the same straight line Fc 2 and straight line P 0 T P 4 T , P 1 T P 5 T intersect at infinity, obviously there is Fc 2 flat and straight line P 0 T P 4 T , according to P 0 T P 3 T ⊥P 0 T P 5 T , we get Therefore, the solution obtains the focal length f;

步骤23,记真实场景中方体上对应于原始图像中方体结构(p0,p1,p2,p3,p4,p5)的六个点为方体结构(Q0,Q1,Q2,Q3,Q4,Q5),显然我们有k=0,1,...,5,,其中代表向量之间的比例,对于模拟场景中的与六个点的方体结构(p0,p1,p2,p3,p4,p5)相对应的方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T),同样必须有k=0,1,...,5其中rk代表向量之间的比例,固定r0的取值为1,利用 求解出r1,r2,r3,r4,r5;当时,Pi与Qi完全重合,此时我们可以完全计算出真实场景中方体结构对应于(p0,p1,p2,p3,p4,p5)的真实坐标,否则有PiPj//QiQj成立,既(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)构成的模型是(Q0,Q1,Q2,Q3,Q4,Q5)构成模型的一个缩放;Step 23, record the six points on the cube in the real scene corresponding to the cube structure (p 0 , p 1 , p 2 , p 3 , p 4 , p 5 ) in the original image as the cube structure (Q 0 , Q 1 , Q 2 ,Q 3 ,Q 4 ,Q 5 ), obviously we have k=0,1,...,5, where representative vector and The ratio between , for the cube structure ( P 0 T , P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T ), must also have k=0,1,...,5 where r k represents the vector and The ratio between, the value of fixed r 0 is 1, using Solve r 1 , r 2 , r 3 , r 4 , r 5 ; when , P i and Q i are completely coincident, at this time we can completely calculate the real coordinates of the cube structure corresponding to (p 0 ,p 1 ,p 2 ,p 3 ,p 4 ,p 5 ) in the real scene, otherwise there is P i P j //Q i Q j is established, that is, the model formed by (P 0 T ,P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T ) is (Q 0 ,Q 1 ,Q 2 ,Q 3 ,Q 4 ,Q 5 ) constitute a scaling of the model;

步骤24,依据步骤23得到的比例r0,r1,r2,r3,r4,r5计算出模拟场景中对应于方体结构(p0,p1,p2,p3,p4,p5)的方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T),设定P0 T与p0重合,定义场景中心为过场景中方体结构中顶点P0 T在主光轴上的投影点,此处为原点O,即模拟场景中心落在原点上,对应于真实场景中Q0在主光轴上的投影点,真实场景中心OQStep 24, according to the ratios r 0 , r 1 , r 2 , r 3 , r 4 , and r 5 obtained in step 23, calculate the corresponding cubic structure (p 0 , p 1 , p 2 , p 3 , p 4 ,p 5 ) cube structure (P 0 T ,P 1 T ,P 2 T ,P 3 T ,P 4 T ,P 5 T ), set P 0 T to coincide with p 0 , define the center of the scene as over The projection point of the vertex P 0 T on the main optical axis in the cube structure in the scene, here is the origin O, that is, the center of the simulated scene falls on the origin, corresponding to the projection point of Q 0 on the main optical axis in the real scene, the real The scene center O Q .

步骤3中,在新视点下重新投影模拟的三维方体结构。In step 3, the simulated 3D cube structure is reprojected under the new viewpoint.

步骤3具体包括以下步骤:Step 3 specifically includes the following steps:

步骤31,依据步骤2得到的模拟方体结构(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T),我们在以O为圆心|OF|为半径的球面上随机取一个新视点O',其中的夹角不超过45度,过模拟场景中心O构造垂直于OO'的平面I',求得点(P0 T,P1 T,P2 T,P3 T,P4 T,P5 T)与O'的连线与平面I'的新交点(p'0,p1',p'2,p'3,p'4,p'5),完成了模拟场景中方体结构在新视点下的投影;Step 31, according to the simulated cubic structure (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) obtained in step 2, we use O as the center of the circle |OF| Randomly pick a new viewpoint O' on the sphere, where and The included angle does not exceed 45 degrees, and the plane I' perpendicular to OO' is constructed by simulating the center O of the scene to obtain the point (P 0 T , P 1 T , P 2 T , P 3 T , P 4 T , P 5 T ) The new intersection point (p' 0 ,p 1 ',p' 2 ,p' 3 ,p' 4 ,p' 5 ) of the connection line with O' and the plane I' completes the cube structure in the simulation scene under the new viewpoint the projection;

步骤32,将法向量与垂直向量(0,1,0)的叉乘得到单位向量x',将x'与叉乘得到单位向量y',在图像平面I'上以O为原点,向量x'方向为横坐标正向,向量y'方向为纵坐标正向建立图像二维坐标系,将k=0,1,2,...,5分别投影到向量x'、y'两个方向上,得到交点(p'0,p1',p'2,p'3,p'4,p'5)在图像平面I'上的二维坐标,记为点(q0,q1,q2,q3,q4,q5),这样我们得到了原图像中方体结构上六个点在新视点下投影在目标图像上的二维坐标。Step 32, the normal vector Cross product with the vertical vector (0,1,0) to get the unit vector x', and x' with The cross product obtains the unit vector y'. On the image plane I', take O as the origin, the direction of the vector x' is the positive direction of the abscissa, and the direction of the vector y' is the positive direction of the ordinate to establish a two-dimensional image coordinate system. k=0,1,2,...,5 are respectively projected onto the two directions of vectors x' and y' to obtain the intersection point (p' 0 ,p 1 ',p' 2 ,p' 3 ,p' 4 , The two-dimensional coordinates of p' 5 ) on the image plane I' are recorded as points (q 0 , q 1 , q 2 , q 3 , q 4 , q 5 ), so that we get six The 2D coordinates of the point projected on the target image under the new viewpoint.

步骤4中,利用所提取的网格顶点对图像进行Delaunay三角化。In step 4, use the extracted mesh vertices to perform Delaunay triangulation on the image.

步骤4具体包括以下步骤:Step 4 specifically includes the following steps:

步骤41,在步骤1得到的特征网格点的基础上,对于图像的剩余区域随机均匀采点作为网格顶点;Step 41, on the basis of the feature grid points obtained in step 1, randomly and evenly pick points for the remaining regions of the image as grid vertices;

步骤42,在三角化的过程中,以步骤1交互的图像特征线,取同一特征线上相邻顶点连线作为三角网格边,利用带约束的Delaunay三角化对图像进行三角网格化,Delaunay三角化的算法可参见“计算几何(第3版)伯格著世界图书出版社2013-10-1出版,ISBN:9787510061776”。Step 42, in the process of triangulation, use the feature line of the image interactive in step 1, take the connection of adjacent vertices on the same feature line as the edge of the triangle mesh, and use the constrained Delaunay triangulation to triangulate the image, The algorithm of Delaunay triangulation can be found in "Computational Geometry (3rd Edition) published by Berg World Book Press on October 1, 2013, ISBN: 9787510061776".

步骤5中,构造图像变形的能量约束。In step 5, energy constraints for image deformation are constructed.

步骤5具体包括以下步骤:Step 5 specifically includes the following steps:

步骤51,利用步骤32计算出的(p0,p1,p2,p3,p4,p5)所对应的新视点下像平面上的像素点(q0,q1,q2,q3,q4,q5),利用计算得到点vci对应的点v'ci,其中vci为原图像硬约束特征直线上的网格顶点,ps,pe为vci所在硬约束特征直线上的两个端点,qs,qe为分别为与ps,pe对应的点,即{vc1,vc2,...,vck}在新视点O'下被映射为{v'c1,v'c2,...,v'ck},记其对应的硬约束关系为FC(v'c1,v'c2,...,v'ck)=0,表明在图像变形映射时vci被映射到v'ciStep 51 , use the pixel points ( q 0 , q 1 , q 2 , q 3 ,q 4 ,q 5 ), using Calculate the point v' ci corresponding to the point v ci , where v ci is the grid vertex on the original image hard-constrained feature line, p s , pe are the two endpoints on the hard-constrained feature line where v ci is located, q s , q e are points corresponding to p s and p e respectively, that is, {v c1 ,v c2 ,...,v ck } is mapped to {v' c1 ,v' c2 ,.. .,v' ck }, record its corresponding hard constraint relationship as F C (v' c1 ,v' c2 ,...,v' ck )=0, indicating that v ci is mapped to v' during image deformation mapping ci ;

步骤52,定义形状约束:将二维三角网格仿射变换记为M:(x,y)→(x',y'),依据柯西‐黎曼(Cauchy–Riemann)方程有:Step 52, define shape constraints: record the affine transformation of the two-dimensional triangular mesh as M:(x,y)→(x',y'), according to the Cauchy-Riemann equation:

∂∂ Mm ∂∂ xx ++ ii ∂∂ Mm ∂∂ ythe y == 00

其中i为虚数单位,关于柯西‐黎曼方程,可参见“LSCM:Least squares conformalmaps for automatic texture atlas generation,ACM Transactions on Graphics,21(3):362‐372.”,映射M对应的雅克比矩阵具有如下形式:Where i is the imaginary unit. Regarding the Cauchy-Riemann equation, please refer to "LSCM: Least squares conformal maps for automatic texture atlas generation, ACM Transactions on Graphics, 21(3): 362-372." The Jacobian corresponding to the mapping M The matrix has the following form:

其中a,b取值任意,用以表示矩阵J中各元素间相等以及互为相反数的关系;Among them, a and b take any value, which is used to represent the relationship between the elements in the matrix J that are equal and opposite to each other;

对应原网格到目标网格的变换,我们采用放射变换;记原三角形为T(vti,vtj,vtk),vti,vtj,vtk为其三个顶点,其对应视点变换后待求解的变形三角形为T'(v'ti,v'tj,v'tk),v'ti,v'tj,v'tk为与vti,vtj,vtk一一对应的三个顶点,A=T'T-1是从T到T'的仿射变换矩阵,T-1具有如下形式:Corresponding to the transformation from the original grid to the target grid, we use radial transformation; record the original triangle as T(v ti ,v tj ,v tk ), v ti ,v tj ,v tk are its three vertices, and the corresponding viewpoint transformation The deformed triangle to be solved is T'(v' ti , v' tj , v' tk ), and v' ti , v' tj , v' tk are three corresponding to v ti , v tj , v tk Vertex, A=T'T -1 is an affine transformation matrix from T to T', T -1 has the following form:

TT -- 11 == aa 11 bb 11 dd 11 aa 22 bb 22 dd 22 aa 33 bb 33 dd 33 == xx titi xx tjtj xx tktk ythe y titi ythe y tjtj ythe y tktk zz titi zz tjtj zz tktk -- 11 -- -- -- (( 22 ))

xti,xtj,xtk为点vti,vtj,vtk在图像上的横坐标,yti,ytj,ytk为点vti,vtj,vtk在图像上的纵坐标,zti,ztj,ztk为用于表示vti,vtj,vtk的竖坐标,这里统一取值为1;a1,a2,a3,b1,b2,b3,c1,c2,c3是矩阵T-1中各个元素的参数表示,值都为计算得到的常数,由式(1)和(2)推得保角映射的如下能量方程:x ti , x tj , x tk are the abscissas of v ti , v tj , v tk on the image, y ti , y tj , y tk are the ordinates of v ti , v tj , v tk on the image, z ti , z tj , z tk are the vertical coordinates used to represent v ti , v tj , v tk , where the uniform value is 1; a 1 , a 2 , a 3 , b 1 , b 2 , b 3 , c 1 , c 2 , and c 3 are the parameter representations of each element in the matrix T-1, and the values are all constants obtained by calculation. The following energy equation of the conformal mapping is deduced from formulas (1) and (2):

ETJ1=a1x'ti+a2x'tj+a3x'tk+(b1y'ti+b2y'tj+b3y'tk) (3)E TJ1 =a 1 x' ti +a 2 x' tj +a 3 x' tk +(b 1 y' ti +b 2 y' tj +b 3 y' tk ) (3)

ETJ2=b1x'ti+b2x'tj+b3x'tk-(a1y'ti+a2y'tj+a3y'tk)E TJ2 =b 1 x' ti +b 2 x' tj +b 3 x' tk -(a 1 y' ti +a 2 y' tj +a 3 y' tk )

其中x'ti,x'tj,x'tk分别为v'ti,v'tj,v'tk的横坐标值,y'ti,y'tj,y'tk分别为v'ti,v'tj,v'tk的纵坐标值,将它们联合在一起得到:Where x' ti , x' tj , x' tk are the abscissa values of v' ti , v' tj , v' tk respectively, y' ti , y' tj , y' tk are respectively v' ti , v' tj , the ordinate value of v' tk , combine them together to get:

EE. SS == ΣΣ TT (( EE. TJTJ 11 22 ++ EE. TJTJ 22 22 )) -- -- -- (( 44 ))

定义特征线约束:记(vi,vj,vk)为一条特征线上的连续三个点,保持之间的比例rlj以及旋转角度θlj,定义如下目标方程:Define feature line constraints: record (v i , v j , v k ) as three consecutive points on a feature line, keep and The ratio between r lj and the rotation angle θ lj , define the following objective equation:

EE. LL == ΣΣ (( vv lili ,, vv ljlj ,, vv lklk )) || || (( vv lklk ′′ -- vv ljlj ′′ )) -- rr ljlj RR ljlj (( vv ljlj ′′ -- vv lili ′′ )) || || 22 -- -- -- (( 55 ))

其中 R lj = cos θ lj - sin θ lj sin θ lj cos θ lj , in R lj = cos θ lj - sin θ lj sin θ lj cos θ lj ,

定义垂直及水平约束:在目标图像中应力争保持原本垂直或水平的直线,不失一般性,假设垂直线段lv上的网格点记为{vlv1,vlv2,...,vlvm},垂直约束可表示为:Define vertical and horizontal constraints: In the target image, we should strive to maintain the original vertical or horizontal straight line, without loss of generality, assuming that the grid points on the vertical line segment lv are recorded as {v lv1 ,v lv2 ,...,v lvm } , the vertical constraint can be expressed as:

EE. VV == ΣΣ lvlv ΣΣ nvnv == 11 lvmlvm (( xx nvnv ′′ -- xx lvlv 11 ′′ )) 22 -- -- -- (( 66 )) ,,

其中x'nv表示点v'nv横坐标,x'lv1表示点v'lv1横坐标。定义水平约束:记水平线段lh上的网格点记为{vlh1,vlh2,...,vlhm},垂直约束表示为:Among them, x' nv represents the abscissa of point v' nv , and x' lv1 represents the abscissa of point v' lv1 . Define horizontal constraints: record the grid points on the horizontal line segment lh as {v lh1 ,v lh2 ,...,v lhm }, and the vertical constraints are expressed as:

EE. Hh == ΣΣ lhlh ΣΣ nhno == 11 lhmlhm (( xx nhno ′′ -- xx lhlh 11 ′′ )) 22 -- -- -- (( 77 )) ,,

其中y'nv表示点v'nv横坐标,yl'h1表示点v'lh1横坐标。Among them, y' nv represents the abscissa of point v' nv , and y l ' h1 represents the abscissa of point v' lh1 .

依据用户交互指定,将原始图像部分或全部边界指定为非硬性特征线约束,记(vbi,vbj,vbk)为边界特征线上的连续三个特征顶点,保持之间的比例rbj定义图像的边界约束EB如下;According to user interaction designation, part or all of the boundary of the original image is designated as a non-rigid feature line constraint, and (v bi , v bj , v bk ) are three consecutive feature vertices on the boundary feature line, keeping and The ratio between r bj defines the boundary constraints E B of the image as follows;

EE. BB == ΣΣ (( vv bibi ,, vv bjbj ,, vv bkbk )) || || (( vv bkbk ′′ -- vv bjbj ′′ )) -- rr bjbj (( vv bjbj ′′ -- vv bibi ′′ )) || || 22

(8)其中rbj之间的比例。(8) where r bj is and ratio between.

步骤53,综合步骤51和步骤52,表示网格参数化的能量方程如下:Step 53, integrating step 51 and step 52, expresses the energy equation of grid parameterization as follows:

argmaxλSESLELVEVHEHBEB (9)argmaxλ S E SL E LV E VH E HB E B (9)

s.t.FC(v1',v'2,...,v'k)=0stF C (v 1 ',v' 2 ,...,v' k )=0

其中λSLVHB为各能量项对应的权值,在实际的运行过程中对于不同的图片参数有一定的调整,经过多组实验图片给出一组经验参数值如下:λS取1,λL与λB取100,λV和λH取10。Among them, λ S , λ L , λ V , λ H , and λ B are the weights corresponding to each energy item. In the actual operation process, there are certain adjustments for different picture parameters. After multiple sets of experimental pictures, a set of experience is given. The parameter values are as follows: λ S takes 1, λ L and λ B take 100, and λ V and λ H take 10.

步骤6中,利用网格贴图生成目标图像。In step 6, the target image is generated using the grid map.

步骤6具体包括以下步骤:Step 6 specifically includes the following steps:

步骤61,依据方程(9),求解出与原图像中各个原三角网格对应目标三角网格,三角网格中的图片纹理采用双线性插值的方法贴图到对应的三角网格,形成目标图像。Step 61, according to equation (9), solve the target triangular grid corresponding to each original triangular grid in the original image, and the picture texture in the triangular grid is mapped to the corresponding triangular grid by bilinear interpolation method to form the target image.

实施例Example

本实施例用于测试的硬件环境是:Intel Core i3-2100CPU3.1GHz主频,4G内存。软件环境是Microsoft Visual Studio软件2008版本、Matlab软件2012a版本和MicrosoftWindows7操作系统旗舰版。具体的过程参见图4的实施实例。The hardware environment used for testing in this embodiment is: Intel Core i3-2100CPU3.1GHz main frequency, 4G memory. The software environment is Microsoft Visual Studio software version 2008, Matlab software version 2012a and Microsoft Windows7 operating system flagship version. For the specific process, refer to the implementation example in FIG. 4 .

本实例根据输入图片产生网格密度的不同,计算求解时间从一百毫秒到几百毫秒不等。如图4所示,本发明的方法首先对输入图像进行交互,加粗实线标注了交互得到的隐含方体主体结构,其余虚线则是用户手工标注的特征线以及指定的图像边界;在交互图基础上一方面采用带约束的Delaunay方法对图像进行三角网格化,另一方面则通过建立模拟三维模型然后重投影得到新视点下投影的方体主体结构;结合网格参数化能量项以及重投影得到的目标结构约束求解出目标网格图像;对生成的网格图像进行边界编辑而得到新视点下的结果图像。另外图5显示了采用本发明的方法生成的结果与奥多比公司Lightroom软件的效果对比图,相比于Lightroom结果中用圈圈标注的瑕疵,本发明方法很好地避免了该类情况的发生;图6显示了本发明方法在球面视域内以多个新视点对场景观测的结果,中心的图是输入图像,而剩余的12幅场景是由各自对应的视点渲染生成的结果图像,通过视点插值进而得到网格顶点位置插值,在计算得到了关键的视点结构后,可以利用网格插值方法实时生成当前球面视域下不同视点的场景图。In this example, the calculation and solution time varies from one hundred milliseconds to several hundred milliseconds depending on the grid density generated by the input image. As shown in Figure 4, the method of the present invention firstly interacts with the input image, the bold solid line marks the hidden cube body structure obtained through interaction, and the rest of the dotted lines are the feature lines manually marked by the user and the specified image boundaries; On the basis of the interactive graph, on the one hand, the Delaunay method with constraints is used to triangulate the image; on the other hand, the cube main structure projected under the new viewpoint is obtained by building a simulated 3D model and then reprojected; combined with the grid parameterization energy item And the target structure constraints obtained by reprojection are solved to obtain the target grid image; the boundary editing is performed on the generated grid image to obtain the result image under the new viewpoint. In addition, Fig. 5 shows the effect comparison diagram between the result generated by the method of the present invention and the Adobe Lightroom software. Compared with the flaws marked with circles in the Lightroom results, the method of the present invention has avoided the failure of this type of situation well. Occurrence; Fig. 6 has shown the result of scene observation with multiple new viewpoints in the spherical field of view of the present invention method, and the figure of center is input image, and remaining 12 scenes are the result images that are generated by respective corresponding viewpoint rendering, through Viewpoint interpolation is then used to obtain grid vertex position interpolation. After calculating the key viewpoint structure, the grid interpolation method can be used to generate scene graphs of different viewpoints under the current spherical view in real time.

本发明的方法以一张实拍图像作为输入,通过简单的交互和计算恢复图像的主体线三维结构,采用图像变形的方法生成视点变换后的全新图像,即保证了结果图像的真实性,同时保证了结果的物理合理性,此外由于本发明方法不需要进行精确的三维场景重建,方法的效率高。The method of the present invention takes a real shot image as input, restores the three-dimensional structure of the main body line of the image through simple interaction and calculation, and uses the method of image deformation to generate a brand new image after viewpoint transformation, which ensures the authenticity of the resulting image, and at the same time The physical rationality of the result is guaranteed, and because the method of the present invention does not require accurate three-dimensional scene reconstruction, the method has high efficiency.

Claims (7)

1. the image viewpoint change method based on single width input picture, is characterized in that, comprises the following steps:
Step 1, image is mutual: extract the cube structure in image, wherein six corresponding image projection of point of square body of markPixel, and obtain alternately the characteristic curve in image, characteristic curve comprises the characteristic curve that affects picture material, horizontal and vertical is approximatelyBunch section and specify image boundary line;
Step 2, utilizes pinhole camera image-forming principle to rebuild a three-dimensional scenic in conjunction with the spatial character of cube structure object, is lookingWhen point transformation, by this three-dimensional scene structure Reality simulation three-dimensional scene structure, in hypothesis three-dimensional scenic, cube structure whereinOn the basis that the picture point on image overlaps with it, a summit, the geometrical constraint that the side's of utilization body comprises, calculates in step 1The three dimensions point coordinates of six some correspondences;
Step 3, utilizes the square body corresponding to space coordinates of six points that under new viewpoint, re-projection step 2 calculates, and representsThe three-dimensional scenic of rebuilding: using the central point of image as step 2 reconstruction of three-dimensional scene center, be designated as O; Taking O as the centre of sphere, this sceneCenter is to the distance of camera | in the ball plane that OF| is radius, define a new viewpoint O', in the three-dimensional scenic that step 2 is rebuildCube structureAgain project to picture plane corresponding to new viewpoint;
Step 4, image triangle gridding: according to the result of step 1, utilize the Delaunay trigonometric ratio of belt restraining to carry out imageTriangle gridding;
Step 5, mesh parameterization: utilize conformal projection principle and feature to keep constraint to set up the equation of mesh parameterization, profitThe hard constraint that obtains scene side's body framework structure projection mapping with step 3 re-projection, solves parametrization energy equation, obtains netLattice;
Step 6, target image generates: solve the grid obtaining according to step 5, by net corresponding with target gridding in original imageCheck reason utilizes bilinear interpolation method to be mapped to one by one target gridding, generates target image.
2. a kind of image viewpoint change method based on single width input picture according to claim 1, described step 1 toolBody comprises the following steps:
Step 11, described single width input picture, implicit cube structure in its scene, mark out alternately this cube structure at imageIn projection, with six point (p0,p1,p2,p3,p4,p5) expression cube structure, wherein (p0,p1,p2,p3) four points are correspondingSpace three-dimensional planar quadrature is in (p0,p1,p5,p4) four corresponding three-dimensional planars of point, p0p1Corresponding space line is two flatThe intersection of face;
Step 12, the cube structure (p obtaining according to step 110,p1,p2,p3,p4,p5), by cube structure (p in image0,p1, p2,p3,p4,p5) between the line that comprises be all labeled as hard constraint characteristic curve, on these hard constraint characteristic curves, extract equably threeAngle grid vertex, concrete grammar is as follows: to a specific hard constraint characteristic curve, start to get a little from one end, along rectilinear direction every25 pixel distances are got the next point on this straight line, until the other end of straight line, for getting on all hard constraint characteristic curvesThe grid vertex obtaining, is designated as { vc1,vc2,...,vck, the hard constraint grid vertex sum that wherein ck representative is extracted;
Step 13, obtains the characteristic straight line in image alternately, comprises the Eigenvector that affects picture material, horizontal and vertical constraintEvenly get a little on described characteristic straight line line segment and specify image boundary line, and concrete grammar is as follows: straight to a special characteristicLine, starts to get a little from one end, gets the next point on this straight line along rectilinear direction every 25 pixel distances, until straight line is anotherOne end;
Step 14 for the indicatrix in image, is extracted triangulation network lattice point successively on curve, and concrete grammar is as follows: from spyThe one end of levying curve starts, along indicatrix prolonging direction, using 25 pixel distances as getting an interval, until arrive featureThe other end of curve.
3. a kind of image viewpoint change method based on single width input picture according to claim 2, described step 2 toolBody comprises the following steps:
Step 21, taking picture centre as initial point O (0,0,0), O to camera loca F (0,0, f) be Z axis forward, the plane of delineationTransverse axis and y direction are that XY direction of principal axis is set up three-dimensional world coordinate system, and wherein f is camera focus;
Step 22, finds out respectively plane (p0,p1,p2,p3) and plane (p0,p1,p5,p4) the vanishing point c that forms on as plane1With c2, obtain according to vanishing point scaling algorithmObtain focal distance f so solve;
Step 23, the cube structure in note true three-dimension scene is corresponding to the cube structure (p of six points0,p1,p2,p3,p4,p5)Point be cube structure (Q0,Q1,Q2,Q3,Q4,Q5), have according to pin-hole imaging model:WhereinRepresentation vectorWithBetween ratio; For in simulated scenario and cube structure (p six points0,p1,p2,p3, p4,p5) corresponding cube structureFormulaSet up wherein rkGenerationTable vectorWithBetween ratio, fixing r0Value be 1, utilize WithSolve r1,r2,r3,r4,r5
Step 24, the r obtaining according to step 230,r1,r2,r3,r4,r5, calculate in simulated scenario corresponding to cube structure (p0, p1,p2,p3,p4,p5) cube structureSetWith p0Overlap, definition scene center is interludeSummit in cube structure in scapeSubpoint on primary optical axis is initial point O herein, and simulated scenario center is dropped on initial point,Corresponding to Q in real scene0Subpoint on primary optical axis, i.e. real scene center OQ
4. a kind of image viewpoint change method based on single width input picture according to claim 3, described step 3 toolBody comprises the following steps:
Step 31, obtains cube structure according to step 24Taking O as the center of circle | OF| is as radiusOn sphere, get at random a new viewpoint O', whereinWithAngle be no more than 45 degree, through simulated scenario center O structurePerpendicular to the planar I of OO' ', try to achieve cube structureWith the line of new viewpoint O', remember itself and planeThe new intersection point of I' is (p'0,p′1,p'2,p'3,p'4,p'5), complete the throwing of cube structure under new viewpoint O' in simulated scenarioShadow;
Step 32, by normal vectorObtain unit vector x' with the multiplication cross of vertical vector (0,1,0), by x' withMultiplication cross obtainsTo unit vector y', on plane of delineation I' taking O as initial point, vector x ' direction is abscissa forward, vectorial y' direction is sat for verticalMark forward is set up image two-dimensional coordinate system, willProject to respectively vector x ', on y' both direction, obtainIntersection point (p'0,p′1,p'2,p'3,p'4,p'5) two-dimensional coordinate on plane of delineation I', be designated as point (q0,q1,q2,q3,q4,q5),Obtain in original image six points on cube structure and under new viewpoint, be projected in the two-dimensional coordinate on target image.
5. a kind of image viewpoint change method based on single width input picture according to claim 4, described step 4 toolBody comprises the following steps:
Step 41, on the basis of the triangulation network lattice point obtaining in step 1, evenly adopts a conduct at random for the remaining area of imageGrid vertex;
Step 42, in the process of trigonometric ratio, with the mutual characteristics of image line of step 1, gets adjacent vertex on same characteristic curve and connectsLine, as triangle gridding limit, utilizes the Delaunay trigonometric ratio of belt restraining to carry out triangle gridding to image.
6. a kind of image viewpoint change method based on single width input picture according to claim 5, described step 5 toolBody comprises the following steps:
Step 51, the two-dimensional coordinate point (q that utilizes step 32 to obtain0,q1,q2,q3,q4,q5), according to formulaCalculate a vciCorresponding some v'ci, wherein vciFor the grid vertex on original image hard constraint characteristic straight line, ps,peFor vciTwo end points on the hard constraint characteristic straight line of place, qs,qeFor being respectively and ps,peCorresponding point, i.e. { vc1,vc2,...,vck}Under new viewpoint O', be mapped as { v'c1,v'c2,...,v'ck, remember that it is F that its corresponding hard constraint closesC(v'c1,v'c2,..., v'ck)=0, shows v in the time that anamorphose is shone uponciBe mapped to v'ci
Step 52, definition shape constraining: two-dimentional triangle gridding affine transformation is designated as to M:(x, y) → (x', y'), according to Cauchy-Riemann's equation:
∂ M ∂ x + i ∂ M ∂ y = 0 ,
Wherein i is imaginary unit, and Jacobian matrix corresponding to mapping M has following form:
J = a b b - a - - - ( 1 ) ,
Wherein a, b value is any, in order to equate and the relation of opposite number each other between each element in representing matrix J;
Corresponding former grid, to the conversion of target gridding, adopts affine transformation; Remember that former triangle is T (vti,vtj,vtk),vti,vtj, vtkFor its three summits, after its corresponding viewpoint change, deforming triangle to be solved is T'(v'ti,v'tj,v′tk),v'ti,v'tj, v′tkFor with vti,vtj,vtkThree summits one to one, A=T'T-1The affine transformation matrix from T to T', T-1Have as followsForm:
T - 1 = a 1 b 1 d 1 a 2 b 2 d 2 a 3 b 3 d 3 = x t i x t j x t k y t i y t j y t k z t i z t j z t k - 1 - - - ( 2 ) ,
Wherein, xti,xtj,xtkFor a vti,vtj,vtkAbscissa on image, yti,ytj,ytkFor a vti,vtj,vtkAt imageOn ordinate, zti,ztj,ztkFor for representing vti,vtj,vtkOrdinate, unified value is 1 here; a1,a2,a3,b1,b2, b3,c1,c2,c3It is matrix T-1In the Parametric Representation of each element, obtained the following energy side of conformal projection by formula (1) and formula (2)Journey:
E T J 1 = a 1 x t i ′ + a 2 x t j ′ + a 3 x t k ′ + ( b 1 y t i ′ + b 2 y t j ′ + b 3 y t k ′ ) E T J 2 = b 1 x t i ′ + b 2 x t j ′ + b 3 x t k ′ - ( a 1 y t i ′ + a 2 y t j ′ + a 3 y t k ′ ) - - - ( 3 ) ,
Wherein x'ti,x'tj,x'tkBe respectively v'ti,v'tj,v′tkAbscissa value, y'ti,y'tj,y'tkBe respectively v'ti,v'tj, v′tkOrdinate value, their gangs are obtained:
E S = Σ T ( E T J 1 2 + E T J 2 2 ) - - - ( 4 )
Defined feature line constraint: note (vli,vlj,vlk) be continuous three points on a characteristic curve, keepWithBetweenRatio rljAnd anglec of rotation θlj, be defined as follows target equation:
E L = Σ ( v l i , v l j , v l k ) | | ( v l k ′ - v l j ′ ) - r l j R l j ( v l j ′ - v l i ′ ) | | 2 - - - ( 5 ) ,
Wherein
Definition vertical constraint: remember that the mesh point on vertical line segment lv is designated as { vlv1,vlv2,...,vlvm, vertical constraint is expressed as:
E V = Σ l v Σ n v = 1 l v m ( x n v ′ - x l v 1 ′ ) 2 - - - ( 6 ) ,
Wherein x'nvRepresent some v'nvAbscissa, x'lv1Represent some v'lv1Abscissa;
Definition horizontal restraint: the mesh point on note horizontal line section lh is designated as { vlh1,vlh2,...,vlhm, vertical constraint is expressed as:
E H = Σ l h Σ n h = 1 l h m ( y n h ′ - y l h 1 ′ ) 2 - - - ( 7 ) ,
Wherein y'nvRepresent some v'nvAbscissa, y'lh1Represent some v'lh1Abscissa;
Specify according to user interactions, non-rigid Characteristic constraint line is appointed as in part or all of original image border, note (vbi,vbj, vbk) be continuous three the feature summits on boundary characteristic line, keepWithBetween ratio rbjThe limit of definition imageBound constrained EBAs follows;
E B = Σ ( v b i , v b j , v b k ) | | ( v b k ′ - v b j ′ ) - r b j ( v b j ′ - v b i ′ ) | | 2 - - - ( 8 ) ,
Wherein rbjForWithBetween ratio;
Step 53, according to step 51 and step 52, represents that the energy equation of mesh parameterization is as follows:
arg maxλ S E S + λ L E L + λ V E V + λ H E H + λ B E B s . t . F C ( v c 1 ′ , v c 2 ′ , ... , v c k ′ ) = 0 - - - ( 9 ) ,
Wherein λSLVHBFor weights corresponding to each energy term, λSGet 1, λLWith λBGet 100, λVAnd λHGet 10.
7. a kind of image viewpoint change method based on single width input picture according to claim 6, described step 6 toolBody comprises the following steps:
Step 61, according to formula (9), solves and the target triangle gridding that in original image, each triangle gridding is corresponding, by former trianglePicture texture in grid adopts the method for bilinear interpolation to be mapped to corresponding target triangle gridding, forms target image.
CN201410107055.2A 2014-03-21 2014-03-21 Image viewpoint transformation method based on single input image Expired - Fee Related CN103955960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410107055.2A CN103955960B (en) 2014-03-21 2014-03-21 Image viewpoint transformation method based on single input image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410107055.2A CN103955960B (en) 2014-03-21 2014-03-21 Image viewpoint transformation method based on single input image

Publications (2)

Publication Number Publication Date
CN103955960A CN103955960A (en) 2014-07-30
CN103955960B true CN103955960B (en) 2017-01-11

Family

ID=51333229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410107055.2A Expired - Fee Related CN103955960B (en) 2014-03-21 2014-03-21 Image viewpoint transformation method based on single input image

Country Status (1)

Country Link
CN (1) CN103955960B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898272A (en) * 2015-12-28 2016-08-24 乐视致新电子科技(天津)有限公司 360-degree image loading method, loading module and mobile terminal
CN107845068B (en) * 2016-09-18 2021-05-11 富士通株式会社 Image viewing angle conversion device and method
CN108961395B (en) * 2018-07-03 2019-07-30 上海亦我信息技术有限公司 A method of three dimensional spatial scene is rebuild based on taking pictures
CN109413404B (en) * 2018-09-06 2019-10-25 宁波大学 A Stereoscopic Image Zooming Method
CN110956583B (en) * 2018-09-26 2022-05-10 华为技术有限公司 Spherical image processing method and device and server
CN112702590B (en) * 2020-12-07 2022-07-22 宁波大学 A kind of stereo image zoom method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999008178A1 (en) * 1997-08-12 1999-02-18 Matsushita Electric Industrial Co., Ltd. Window display
CN101635061A (en) * 2009-09-08 2010-01-27 南京师范大学 Adaptive three-dimensional rendering method based on mechanism of human-eye stereoscopic vision

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999008178A1 (en) * 1997-08-12 1999-02-18 Matsushita Electric Industrial Co., Ltd. Window display
CN101635061A (en) * 2009-09-08 2010-01-27 南京师范大学 Adaptive three-dimensional rendering method based on mechanism of human-eye stereoscopic vision

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Changing Perspective in Stereoscopic Images;Song-Pei Du 等;《IEEE Transactions on Visualization and Computer Graphics》;20130831;第19卷(第8期);1288-1297 *
Imag e Warps for Ar tistic Perspective Manipulation;Robert Carroll 等;《ACM Transactions on Graphics》;20100731;第29卷(第4期);127:1-127:9 *
Interactive Imag es: Cuboid Proxies for Smart Image Manipulation;Youyi Zheng 等;《Acm Transactions on Graphics》;20120731;第31卷(第4期);99:1-99:11 *
Localizing 3D cuboids in single-view images;Jianxiong Xiao 等;《NIPS》;20121231;1-9 *

Also Published As

Publication number Publication date
CN103955960A (en) 2014-07-30

Similar Documents

Publication Publication Date Title
Zhang et al. A UAV-based panoramic oblique photogrammetry (POP) approach using spherical projection
CN103955960B (en) Image viewpoint transformation method based on single input image
CN103021017B (en) Three-dimensional scene rebuilding method based on GPU acceleration
CN103077509B (en) Discrete cubic panorama is utilized to synthesize the method for continuously smooth panoramic video in real time
EP3534336B1 (en) Panoramic image generating method and apparatus
CN103500467B (en) Threedimensional model constructive method based on image
CN110490916A (en) Three dimensional object modeling method and equipment, image processing apparatus and medium
CN109035388A (en) Three-dimensional face model method for reconstructing and device
CN116051747A (en) A method, equipment, and medium for reconstructing a 3D model of a building based on missing point cloud data
CN101958008B (en) Automatic texture mapping method in three-dimensional reconstruction of sequence image
CN103530907B (en) Complicated three-dimensional model drawing method based on images
CN116543117B (en) A high-precision three-dimensional modeling method for large scenes from drone images
CN110570522A (en) A multi-view 3D reconstruction method
CN113313828B (en) 3D reconstruction method and system based on single image eigenimage decomposition
CN109035327B (en) Panoramic camera pose estimation method based on deep learning
CN106558017B (en) Spherical display image processing method and system
CN104463969B (en) A kind of method for building up of the model of geographical photo to aviation tilt
Liu et al. Real-time neural rasterization for large scenes
CN106534670B (en) It is a kind of based on the panoramic video generation method for connecting firmly fish eye lens video camera group
CN105513063A (en) Calibration of parabolic refraction and reflection camera through Veronese mapping and checkerboard
CN106326334A (en) Display method and device for electronic map and generation method and device for electronic map
Komatsu et al. 360 depth estimation from multiple fisheye images with origami crown representation of icosahedron
CN105550992A (en) High fidelity full face texture fusing method of three-dimensional full face camera
CN107145224A (en) Human eye sight tracking and device based on three-dimensional sphere Taylor expansion
CN106157321B (en) Real point light source position measuring and calculating method based on plane surface high dynamic range image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170111

CF01 Termination of patent right due to non-payment of annual fee