Saturday, February 20, 2010
Deformable Sphere
A parametric sphere is deformed using Perlin Noise computed directly on the GPU.
Labels:
Computer Graphics
Thursday, February 18, 2010
Image Morphing
Morphing is a technique to turn an image into another through a seamless transition and it is mostly used to create a metamorphosis between two person's faces.
To generate this seamless transition, we should know where the pixels of a source image S will end up being in a target image T. To make some calculations simpler, we reverse the problem and instead we find from which position x(S) a pixel of T located at x(T) came from. This sort of inverse warp resembles the semi-lagrangian advection developed by Jos Stam in his famous paper Stable Fluids.
Defined by hand pairs of corresponding points p(S) and p(T), we initially compute a Delaunay Triangulation for the set of points (p(S) + p(T)) / 2. The resulting mesh is displaced to fit into p(S) and p(T) generating a pair of corresponding triangulations t(S) and t(T). Given t(S) and t(T) we proceed computing the set of affine matrices M that maps triangles of t(T) into corresponding triangles of t(S) so that M*t(T) = t(S). Subsequently for each pixel of T located at x(T) = (x,y), contained into a triangle Tr, we compute its corresponding position x(S) through the matrix-vector multiplication M(Tr) * x(T) = x(S). Finally, we warp S into T interpolating the color of the surrounding pixels at x(S) and placing the resulting value in x(T).
To generate this seamless transition, we should know where the pixels of a source image S will end up being in a target image T. To make some calculations simpler, we reverse the problem and instead we find from which position x(S) a pixel of T located at x(T) came from. This sort of inverse warp resembles the semi-lagrangian advection developed by Jos Stam in his famous paper Stable Fluids.
Defined by hand pairs of corresponding points p(S) and p(T), we initially compute a Delaunay Triangulation for the set of points (p(S) + p(T)) / 2. The resulting mesh is displaced to fit into p(S) and p(T) generating a pair of corresponding triangulations t(S) and t(T). Given t(S) and t(T) we proceed computing the set of affine matrices M that maps triangles of t(T) into corresponding triangles of t(S) so that M*t(T) = t(S). Subsequently for each pixel of T located at x(T) = (x,y), contained into a triangle Tr, we compute its corresponding position x(S) through the matrix-vector multiplication M(Tr) * x(T) = x(S). Finally, we warp S into T interpolating the color of the surrounding pixels at x(S) and placing the resulting value in x(T).
|
|
|
|
|
|
Labels:
Computational Photography
Subscribe to:
Posts (Atom)