This software uses complex barycentric coordinates to implement deformations of input images. It uses the algorithms described in "Complex Barycentric Coordinates with Applications to Planar Shape Deformation" by Weber et. al. It implements both Cauchy-Green coordinates and P2P Cauchy-Green coordinates as described in the paper.

The user draws a polygon around the portions of the image they wish to deform, then deforms this polygon to deform the image. In P2P coordinates mode, the user is given a much more intuitive interface where they place additional control points within their drawn boundary polygon and then defines their deformation simply by dragging these control points. This way, the user can place control points on the hands, elbow and armpit of a figure, for instance, and easily position the arms in a realistic manner.

Unlike previous labs, this lab uses GLUT, which means it is not nearly as convenient. I may move it over to a Cocoa interface later if I have time.
User Interface
There are two coordinate systems (Cauchy-Green, P2P Cauchy Green) the user can switch between by pressing the 's' key.

There are also two editing modes (Control Point Insertion, Deformation) the user can switch between by pressing the 'm' key. In insertion mode, the user draws a polygon by left clicking to add new points in sequence. NOTE: Points must be inserted in counter-clockwise order. I will fix this in the future by computing the winding number about an interior point and reversing the vertex order if it is negative. If in P2P mode, handles can be inserted by right clicking. Only insert handles within the boundary polygon.
In deformation mode, use the left mouse button to drag the red points. In P2P mode, these are the specified control points, and in regular Cauchy-Green mode, these are cage vertices.

The current coordinate and editing modes are displaed in the lower lefthand corner of the screen.

Press 'c' to clear the inserted cage/control points.
Press 'r' to reset the modified cage/control points to their original locations.
Press 'h' to hide the cage/control points.
Press 'w' to display the wireframe onto which the texture is mapped.
Press 't' to return to the frog display.
Cauchy-Green Examples
Here is an example deformation of the frog image using regular Cauchy-Green coordinates.
P2P Cauchy-Green Examples
Here are some example deformations of the frog image using P2P Cauchy-Green coordinates.
This program is written in C++ using libpng and GLUT. It should compile on most Linux, Windows, and Mac OS X machines if the proper libraries are installed. You should be able to run the program by first typing 'make' and then running './hw3'.

As usual, please be aware that this is by no means polished software, as it was written for a weekly assignment.
Design and code ©2012 Julian Panetta
Valid HTML 4.01 Strict