I implemented this system for the final project of my computer vision class. Couldn't get it to work by the deadline, but I'm very familiar with this paper. Happy to answer any questions.
Relative paths allowed from user input is usually a HUGE warning sign. Are you sure I can't make it open arbitrary files? What happens to your cgi script if it reads a file in the wrong format?