Historical:GSOC 2010 Makefile Lib Proposal

From PanoTools.org Wiki
Jump to navigation Jump to search


Hugin uses GNU Make to drive the actual panorama creation process, it creates a makefile from the project settings to invoke the several tools that create the panorama.

The current makefile output code is not satisfactory. It will be replaced by a reliable library that encapsulates the output of makefiles and handles all makefile-specific issues, especially quoting.

About Me

My name is Florian Achleitner, I'm 26, from Austria and studying Telematics (a blend of computer science and electric engineering) at the Graz University of Technology.

Currently I'm in the second year of my studies. I will graduate to BSc next year and then continue the master studies. Before starting my studies I worked for four years as a developer in industry, mainly on automotive embedded systems.

My Experience

My programming experience grew since I started writing programs on TI calculators in school probably 15 years ago. From my work and university experience I'm good in C, C++, Python, Makefiles, Unix Tools in general, Java, Shell Scripts.. (sorted by experience).

I'm open-source enthusiast, exclusively using Linux since years. Until now I haven't made major contributions to open-source projects, except some bug reports and testing. But I have often checked out source codes, to take a look at how it works, and why something doesn't work. I frequently patched and built my own kernel images. That's why I like the open source spirit, I like to look into things.

My development platform is a Core2Duo E8500 with 4GB RAM running Ubuntu 64bit (currently karmic). For testing I usually setup other platforms in virtual machines.

About Photography

My camera is a Konica Minolta Dimage Z5, which is no longer new or good unfortunately, but provides advanced capture modes. I don't have any special panorama equipment, except a tripod :).

I played with hugin and also commercial panorama tools before. Since many years I like shooting panoramas from mountain summits. I mostly photograph during outdoor activities.

Here are two examples:

Photography is the reason why I apply to hugin. Because I'm interested in photography, creating panoramas and image processing.

About Me, Hugin, and GSOC

Until now, I've never actively contributed to hugin, I was an interested user.

I've also never before participated in GSOC. I see this as an altervative to a regular summer job, which is normally also related to development. So working as much as in a regular job goes without saying.

The Project: Implementing a Makefile Output Library and Integration with the existing Tools

Current situation

Hugin uses makefiles and GNU Make to invoke the tools actually doing the work, when creating a panorama. The makefile contains all configuration values and can therefore be used independently from the hugin project in the GUI, once created.

Currently the makefile is created by one huge method, namely HuginBase::PanoramaMakefileExport::createMakefile(..). Which contains both, the preparation of the data and the output into the makefile. It is hard to maintain and error prone, because of quoting problems and easily occurring violation of makefile syntax when making changes.

Replacement of the Makefile output with a generic library

First step is the creation of bulletproof makefile creation library. The implementation is done in C++. The Design is an object oriented abstraction of the items existing in a makefile. For example, rules dependencies, targets, prerequisites. As a guideline an existing implementation in Perl by Bruno Postle can be used.

An important aspect is, that every object can output itself to the actual makefile, considering quoting and escaping with respect to the GNU Make specification and probably invoked sub-shells. Because this is critical, research about special characters, extensive testing, and creation of a suitable tester is necessary. It's also important to consider differences on different platforms. A top level object will hold an manage all makefile items representations and handle the output and creation.

The code part that currently collects the data to be written to the makefile will be isolated, maybe replaced to use the new makefile framework, and create the representing makefile items. Then changing the panorama creation process no longer involves dealing with makefile syntax or quoting, and is easy to understand and to change.

Adapt Control Point Detection to use Makefile

Changing the invocation of Control Point Creation Tools to use makefiles too has the advantage that this process becomes detachable from the GUI program and can be executed by the batch processor tool PTBatcherGUI.

Extend PTBatcherGUI to queue Makefiles

PTBatcherGUI handles and executes preconfigured actions, currently only stitching of panoramas. The extension of PTBatcherGUI to support generic makefile-based jobs allows us to queue for later processing not only stitching but also control point detection, or automatic detection of panoramas, or whatever we are going to figure out in the future.

Automatic detection of panoramas

Using the makefile framework automatic detection of panoramas by analyzing the photos in a folder can be realized. The detection can consider image metadata, like creation time, or several capture conditions and use control point detectors to find overlapping pictures.


The above described points are probably to much to complete during summer of code. So the core of the project is the creation of the Makefile output library, which will be scheduled first, while the other points come afterwards and may be done after the end of GSOC 2010. Sorted by importance:

  • Replacement of the Makefile output with a generic library
  • Adapt Control Point Detection to use Makefile
  • Extend PTBatcherGUI to queue Makefiles
  • Automatic detection of panoramas

One limitation I face when scheduling GSOC work is, that it's timetable doesn't suit very well to that of the universities in Austria. Our Semester ends with the end of June, that means in this month, there will be a lot of submissions and exams and not too much time to program for GSOC. But our holidays extend until the beginning of October, which allows me to continue working for Hugin for more than a month after GSOC is over.

Because the really busy time is starting in June I'll try to get most fudamental work done until end of May and be good in time when holidays start.

Preliminary Schedule

  • 10. June: Design of the Makefile creation library finished, design classes stubbed.
  • 16. July: (mid-term evaluation): Implementation of Makefile library ready for extensive testing and review.
  • 20. July: Tester framework is up and running, testcases are complete. Integration into the existing hugin code.
  • 9. August: Testing complete, bugs fixed. Hugin uses the new lib. Final code review.
  • 16. August: (pencils-down) Finished documentation, project submission.
  • 30. September: Working on the remaining points. Priority to be discussed.