Saturday, July 7, 2012

Trying all my GSoC projects (seamless clone, triangulation)

It's about time I post this. My work is actually useable enough (I even received my first bug report by email recently) so it's the time to explain how to use this.

In this post I will explain you how to compile Poly2tri-C (the triangulation and mesh generation library), how to compile GEGL with the seamless cloning operation and GIMP with the seamless clone tool.

Ready? Then let us begin!

Poly2tri-C

About

Poly2tri-C is a C library for generating constrained delaunay triangulations and refining them. For those who don't speak computational geometry, it basically means it can generate triangular meshes from given input outlines, where the triangles are all "good" (don't have small angles) and with controllable size.
The library is based on Poly2tri - a C++ library for generating constrained delaunay triangulations. After porting it to C, I combined the algorithm described by Jonathan Richard Shewchuk for triangular mesh generation by refining such triangulations.

Compiling

The instructions below are intended for people with a minimal Linux-like build system (a Unix/Linux machine or something like MSYS/Cygwin on Windows)
  1. Make sure you have the Glib development headers and libraries (you can get them from here)
  2. Download the latest souce of poly2tri-c:
    git clone https://code.google.com/p/poly2tri-c/
  3. Open a command prompt (or a terminal if you are a linux guy) and enter ("cd") the directory of the source code repository
  4. Run the autogen.sh script. Since this script will eventually call the configure script, you may pass the standard options of GNU configure scripts to it
    ./autogen.sh [--prefix=/path/to/install/in]
  5. Now, like every GNU package - run make and make install.

GEGL

About

GEGL is a graph based image processing library, which is gradually integrated into GIMP as it's new image processing core. Inside GEGL I implemented the seamless cloning operation according to the technique suggested in this paper.

Compiling

The instructions below assume you know how to build GEGL and that you already compiled the latest and greatest version of Poly2tri-C.
  1. Download the latest souce of GEGL (see the bottom of this page)
  2. Open a command prompt (or a terminal if you are a linux guy) and enter ("cd") the directory of the source code repository
  3. Switch to the soc-2011-seamless-clone branch:
    git checkout -b soc-2011-seamless-clone
  4. Proceed in compilin GEGL as you always do

GIMP

About

GIMP is the Gnu Image Manipulation Program, and that is the program into which I integrated the seamless cloning operation as a tool as part of Google-Summer-of-Code 2011. Poly2tri-C was actually an unexpected by-product that was created due to a lack of a mesh generation library which matched all my needs (one of them was licensing - which prevented me from using CGAL at that time).

Compiling

The instructions below assume you know how to build GIMP and that you already compiled GEGL as described above.
  1. Download the latest souce of GIMP (see the bottom of this page)
  2. Open a command prompt (or a terminal if you are a linux guy) and enter ("cd") the directory of the source code repository
  3. Switch to the soc-2011-seamless-clone2 branch:
    git checkout -b soc-2011-seamless-clone2
  4. Proceed in compilin GIMP as you always do

Questions? Bug reports? Leave a comment here, and if I don't get back to you, feel free to email me. I tend to forget to check comments here :P My email address is lightningismyname at gmail dot com.

1 comment:

  1. 'git checkout' should be called without -b.

    ReplyDelete