Cristian Marchi 3:22pm, 20 February 2010
As of rev.4978, Thomas Modes added to Hugin the masking feature. That is a very useful function that could save lot of time to panographer and photographer in general. Here I would like to illustarte a way to use POSITIVE masking in the latest version of Hugin.
In my last vacation I went to NYC and I had the idea to shoot a photo of a same scene but with a moving object. The good occasion came in Central Park where some street artists where performing an (hilarious and kinda athletic) show. I was waiting for some free time to do some masking in Gimp and obtain a similar effect, but the introduction of the masking capability to Hugin makes the process more easy.

The photo I will use in this tutorial are here (so you could try it directly):
IMG_1367.JPG by Cristian Marchi

IMG_1368.JPG by Cristian Marchi

IMG_1369.JPG by Cristian Marchi

IMG_1370.JPG by Cristian Marchi

IMG_1371.JPG by Cristian Marchi

I also will use Hugin rev5004 compiled under Ubuntu 9.04 (Jaunty).
If you would like to use this feature under Windows, Zoran Zorkic makes available a zip package of Hugin with masking feature at this link.

Let's start.! open up Hugin and a window of the file browser where the images are.
Select the images in the file browser and drag'n drop them in the Hugin Assistant tab.
screenshot_012 by Cristian Marchi

Press the align button in the same tab and wait for your preferred control point generator to do his work.
screenshot_014 by Cristian Marchi

When the control point generator has finished the calculation you will be presented with the Hugin fast preview window displaying the images aligned to each others.]

Now it's time to create some mask. So head to the mask tab in the Hugin main window and select the first photo of the list on the left. Press now the button marked as add new mask and start adding some points on the image on the right using the left mouse button.
screenshot_016 by Cristian Marchi

When you have finished adding points use the right mouse button to terminate the process.
screenshot_017 by Cristian Marchi

As you can see in the left of the mask tab in the main window of Hugin, the mask type is set to "Exclude region and if fact if you look to the preview window you will see that the guy had disappeared.
screenshot_018 by Cristian Marchi

Now modify the mask type from Exclude region to Include region by using the selector just below the mask type table. You will see now the guy appear in the preview window.
screenshot_019 by Cristian Marchi

Do the same in all the remaining images by creating a mask that identify the jumping guy and by setting it as "Include region" type
screenshot_022 by Cristian Marchi

When you have finished take a look at the fast preview window:
screenshot_023 by Cristian Marchi

Now select the crop tab in the fast preview window and click on the Autocrop button: Hugin will take care of cutting the relevant area of the photo and excluding the black and empty areas
screenshot_024 by Cristian Marchi

Now go back to the Hugin main window and select the stitcher tab; click on Calculate optimal size (in this way you will get as output the maximum resolution possible for the photo) and finally click on Stitch now!. Select a path to save the output and after Hugin has finished the calculation open a file browser and check the result.
screenshot_025 by Cristian Marchi

That's it!

Next is the final image I got using this method:
jump by Cristian Marchi

Thanks to Thomas Modes for this great addition to Hugin!
...and thanks to the guys that did the exhibition in Central Park for being so entertaining!
Thanks a TON for this little tutorial. It's great for masking out the little section of panorama head that's visible in the images, and the legs for the nadir shot.

I just spent an hour trying to figure out how to mask the images without having to run enblend manually, because of the aforementioned issues. Finally I found this tutorial, so I upgraded to the latest Hugin straight away, and BAM.
Cristian Marchi 5 years ago
Thanks, I'm glad that the tutorial was useful! The masking function it's really a great addition to Hugin.
breic 5 years ago
Nice tutorial.
Groups Beta