Archive for the ‘Graphics’ Category

Diffusion Curves

March 10, 2009

Stumbled upon an amazing SIGGRAPH paper on “Diffusion Curves: A Vector Representation for Smooth-Shaded Images”, at the Adobe ATL page : link. Given cartoon sketches represented as Bezier curves, with initial color values on either sides of the curves, they construct an image by letting the colors diffuse as governed by a Poisson equation. This can be used to rapidly create cartoon images and animations. The paper also solves the inverse problem, i.e. given an arbitrary smoothly shaded image, they determine the initial curves and color samples needed to vectorize the image.

Check out their cool demo here.

Diffusion Curves: A Vector Representation for Smooth-Shaded Images

Holger Winnemöller , Adobe Systems
Adrien Bousseau, INRIA, Grenoble, France
Alexandrina Orzan, INRIA, Grenoble, France
Pascal Barla, INRIA, Grenoble, France
Joelle Thollot, INRIA, Grenoble, France
David Salesin, Adobe Systems

zephir_lrg
zephir_sources_lrg

Curvature Display

December 11, 2006

For the Graphics Course final project, I have implemented  the display of  curvature on surfaces. By curvature we mean, Gaussian and Mean curvatures, i.e. the product and mean of principal curvatures k1, k2.

First, we obtained a 3D scan of (my) face and fitted a bicubic B-Spline surface with a 15×15 control point mesh. This is done manually using a tool written in OpenGL, to select each such control point and move it in 3D, so that the resultant surface matches with the scanned point cloud.

frame000.jpg

Since, tangents and normals can be easily computed on bezier patches using the control vector differences, we  convert this B-Spline mesh into a Bezier mesh representing the same surface. The conversion scheme is discussed in Sec.11.2.8 ( Foley).

The figure below illustrates the B-Spline Mesh in blue and Bezier mesh in red.

frame002.jpg

Now, in order to improve display resolution, we can subdivide Bezier mesh using simple (mid-point) rules, again, illustrated in Foley (Sec-11.2.7). When ever a control point (in the initial mesh) is moved by the user, we have to subdivide the Bezier mesh upto the current level. We can implement this efficiently by pre-computing weights to create subdivided mesh points at any level, from the initial (small ) control mesh. Below is an illustration of subdivided Bezier mesh.

frame006.jpg

We then compute curvatures at each mesh point. It involves computing first and second Fundamental forms using first and second derivates and normals. For numerically stable derivatives, we used central differencing.  A texture, created from curvatures at the grid points, is mapped onto the surface. (It can be done using a single call to gluNurbsCurve)

Gaussian Curvature

In the above figure, Gaussian curvature (product of principals) is plotted on the surface. Red color denotes positive values and green corresponds to negative values. We can notice that at valleys and peaks (like nose tip), both the principal curves are either concave or convex resulting in positive (RED) values. How ever, at saddle points (like bridge of the nose) the surface is concave in one (principal) direction and convex in the other, resulting in negative surface curvature.

Mean Curvature

This is the Mean curvature plot. Note that in valley regions, we have only +ve values since both principal curves are concave.

Dev-C++ OpenGL

December 5, 2006

These are the magic linker options required to compile OpenGL code with Dev-C++ IDE.

“Choose “Project” then “Project Options” and click on the “Parameters” tab. In the linker box type in this order:”

-lglut32
-lglu32
-lopengl32
-lglaux
-lgdi32
-lwinmm

Computer Graphics Notes

December 5, 2006

Geometric Modeling — On-Line Notes

This site has been very helpful. I was looking for bi-cubic Bezier / B-Spline patch subdivision and conversion between the two. Ofcourse, the analogue for curves can be found in the textbook by Foley (Sec 11.2.7-8). In fact, this is what we were doing in HW1.