This program was written in Matlab. There are two main programs to run, start.m and start2.m. start implements Poisson Image Editing, while start2 implements it with optimizing the boundary. Thus start2 is much slower than start, as it is doing dykstras algorithm in a loop.
I used a few toolkits from the internet for part 2. The first is SegTool, which implements the GrabCut algorithm. This is used to find Omega_obj, the tight boundary around an object. It requires 2 mex files be compiled (Ive including the 64 bit linux files, but you may need to recompile for your system). The instruction on compilation of these mex files is located in SegTool/README_COMPILE.txt. The second helper file from the internet is mask2poly (along with sortPoint*.m), which converts a binary mask to a polygon boundary. Finally, Im using bresenham.m to rasterize the cut I calculated.