msgbartop
Faut pas y craindre
msgbarbottom

22 avr 08 Hugin: Create a panorama under Ubuntu within 2 minutes

You’ve always dreamt of making panoramas of your holidays pictures. You’ve never done it because you’ve never found the right software in Ubuntu or it was too complicated to set up? Me too. Until recently and the discovery of Hugin.

Let see how to achieve this.

First of all you obviously need of Hugin itself. Fortunately it is part of (K)Ubuntu 7.10 repository!

Just type this into a terminal to install it:
sudo apt-get install hugin

You can then launch it from the K menu (under Kubuntu): Graphics > Hugin. Should be similar with Gnome. Anyway you can launch it from a terminal, calling hugin.

Here is what you should see:

hugin 1

As indicated, the first step is to load the pictures used for the panorama. In my case I will use only 2 pictures, but the process remains the same for a greater number of photos:

Hugin2

Once your pictures are selected you will obtain such screen:

Hugin3

This tab allows you to position your points of control. These points are « commonalities » between the 2 pictures. Hugin will base its extrapolation on it and generate the panorama.


Positionning of the points of control:

The idea is to choose significant points, simple to position: top points, corniche, angle… No need to add thousands of points, 3 or 4 might be enough for a 2-pictures panorama. You’ll be always able to add more later if necessary.

So, I place my first point on the left picture: I chose the top of a roof. When you click to position a point, it automatically zooms and you can refine the point’s position:

Hugin4

I then added its twin on the right picture. Hugin sometimes places it perfectly if you click near the right place. Or you can refine it in zoom mode:

Hugin5

Then click on the Add button (red box above) to save the point:
Hugin6

I then followed the same steps to add 2 more points:

Hugin7

Go back to the « Assistant » tab to finish (red box above).

Panorama creation

Hugin8

As you can see on the screenshot above, Hugin detected successfully 3 points of control and asked to align them. So please Hugin and click on.. Align! (surprised?). The next screen appears:

Hugin8

First overview of what your panorama should look like :) Result is not so bad, and that without any optimization! If necessary you can rotate the picture here (here it was not necessary, the panorama being already well aligned on the horizontal axis).
Update and close the window. Then click on Create the panorama to finish and save your file (.tif) where you want. The panorama calculation starts when you validate and save the picture once done.

Getting the final panorama

As you will see, the picture obtained (here opened in Gimp) will look like this:

Hugin9

Here, 2 choices:

  • Let the panorama like this so as not to loose some parts of the picture, and add a black background to finish
  • Crop (following this tutorial) to get a rectangular picture without any empty area (but with a picture loss)
  • The 2 results

    Black background:

    Hugin10


    Cropped panorama:

    Hugin11


    Not that bad?

    As you surely noticed, there are many tabs in Hugin not used in this tutorial: these tabs are necessary to refine the panorama when it is more complicated, as it is with many pictures. I leave you to explore all the possibilities!

    N.B: This article is a translation, as I used to talk and write in French. Feel free to notify any important mistake.

    Edit:A few english mistakes corrected thanks to David T. review :)

    Be Sociable, Share!

    Reader's Comments

    1. |

      [...] English translation here Articles en rapport (ou pas!) :Hugin: Create a panorama under Ubuntu within 2 minutesUtiliser la [...]

    2. |

      Hi,

      As much as I like Hugin, there is a better alternative, called autostitch. It is unfortunately not open source, nor written for Linux, but it is free and runs on Wine. It stitches automatically and blends with perfection.

    3. |

      Hi,

      hugin combines well with autopano-sift and enblend where autopano-sift automatically selects the control points and enblend nicely blends the aligned images produced by hugin.

    4. |

      Yes it is indeed part of Hugin « advanced preferences » !

    5. |

      [...] Read more at En plein dedans… [...]

    6. |

      Thanks for the tutorial. Here’s my panaroma, not very professional but nevertheless.
      http://img178.imageshack.us/img178/1126/kedarhoneymoonpanaroma0hd2.jpg

    7. |

      You’re very welcome! Good idea to post your panorama… :)

      Where was that photo taken?

    8. |

      Another very good panorama tool for linux is fotox. IMHO it produces better results in less time.
      cya

    9. |

      Story added…

      This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here:

      http://www.fsdaily.com/EndUser/Hugin_Create_a_panorama_under_Ubuntu_within_2_minutes

    10. |

      Hiya,

      Thanks for the information I’ll try it later.

      By the way I see that many Czech people are reading this tutorial :) This panorama is made of pictures taken in their wonderful capital Praha last summer!

    11. |

      Great Program!! Very practical. Your english is pretty good and there are no major mistakes. However, as english is my mother tongue I have taken the liberty of rewriting your text making some minor changes. If you want you can always cut and paste this into your web site. If you contact me I can send you this in document format by email. Here is some of the text:
      Not that bad?
      As you surely noticed, there are many tabs in Hugin that are not used in this tutorial: these tabs are necessary to refine the panorama when it is more complicated, as it is with many pictures. I leave you to explore all of the possibilities!

    12. |

      If you are prepared to pay a small cost (around $100 iirc), there is a great application called AutoPano Pro. Just let it scan a directory with images, and it detects and stitches panoramas automatically. It also has nice features such as exposure compensation (look at the sky in the example above, which is much darker on one of the images, APP would have fixed that) and HDR support. It’s a bit slow, but the results are amazing, and it seldom needs any manual work.

      Well worth a look.

    13. |

      @David: Thanks :) I will send you an email in a few minutes!

      @Troberg: Actually I really make a few panoramas each year (and not every year) so it’s not really worh for me as long as I’m not looking for a professional quality. But HDR support could be interesting :-) Thanks!

    14. |

      Hugin is quite capable of correcting the exposure differences between the two images, as well as vignetting and other lens corrections. While Autopano Pro is a great program, Hugin plus autopano or panomatic can produce equally impressive results.

    Leave a Comment