Hugin Mask tab

From PanoTools.org Wiki
(Difference between revisions)
Jump to: navigation, search
(Editing masks)
(Editing masks: Changed language to reflect more accurate text in the tutorial. Added warning about unusual editing behavior with small masks. Tweaked language elsewhere for consistency and fluency.)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The blender (default is [[Enblend]]) uses any part of an photo overlap to place a seam which can result in part of a person or object being cut by the seam and only appearing in part in the final stitch.
+
{| cellspacing="0" cellpadding="0" style="clear: right; margin-bottom: .5em; float: right; padding: .5em 0 .8em 1.4em; background: none; width:auto"
 +
| __TOC__
 +
|}
 +
= Hugin Masks tab =
 +
The '''Hugin Masks tab''' has two functions:
 +
* Creating '''masks''' for individual images that include or exclude specific parts of these individual images in your final panorama.
 +
* '''Cropping''' one or more of your individual images, as you would do for, e.g., [[fisheye Projection]] images having a circular area in the middle with a useless black area outside, or scanned images that might have edges that need to be ''cropped'' away.
  
By excluding an area using a mask (exclude mask) you are telling the blender to exclude
+
The top-left side of the masks window shows a list of all images in the current project.  
that region from consideration both when placing the seam and when
+
blending. The result is that you can remove a person or object from the final stitch. You should only exclude part of one photo if some other photo shows the same part of the scene without that object.
+
  
When you include an object with a mask (include mask) the opposite happens, this simply removes that part of the scene from all other photos, the blender then has no choice but to use the region in the photo you selected.
+
The '''Masks''' tab has in the mid-section on the left side two sub-tabs ''Masks'' and ''Crop'', each with its own functionality. Note that you have to select an image in the top left before the functionality of both will be enabled.
  
Masks can be saved and reloaded.
+
= Editing masks =
 +
The blender (default is [[Enblend]]) may place a seam on any part of the overlap between photos. This can result in a person or object being cut by the seam and only partly appearing in the final stitch. Blend masking allows you to define an '''include''' region which the blender will try to incorporate into the final stitch, as well as an '''exclude''' region which the blender will try to keep out of the stitch.
  
The left side of the mask window shows a list of all images in the current project.  
+
Blend masks are not like normal "cut and paste" masking. They are more like hints for the blender. Therefore it is not always necessary to carefully define a mask exactly on the boundary of an object. Often it sufficient to roughly enclose the area to be included or excluded. Be careful to exclude a part of one photo only if some other photo shows the same part of the scene, otherwise you will get a black empty area in your final panorama.
The list box below shows all masks of the active image.  
+
  
 +
Note that control points inside an exclude mask are still used in optimization.
  
== Editing masks ==
+
Masks can be saved and reloaded.
  
=== Creating mask polygon ===
+
The top-left side of the masks window shows a list of all images in the current project. The listbox below shows all masks of the active image.
  
After selecting '''add new mask''' set polygon points with left mouse click. Finish polygon with right mouse button or left double
+
== Creating a mask polygon ==
click.
+
  
=== Deleting a mask ===
+
After selecting '''add new mask''' set polygon points with left mouse click. Finish polygon with right mouse button click or double left click.
  
You can delete the active mask by the '''delete mask''' button. The active mask is also deleted by
+
== Deleting a mask ==
pressing the delete key when all or none points of the current mask are selected.
+
  
=== Select mask ===
+
You can delete the active mask by selecting it and clicking the '''Delete mask''' button by the listbox on the left. You can also use your '''delete''' key when all or none of the points of the current mask are selected.
  
There are 3 ways to select a mask
+
== Selecting a mask ==
 +
 
 +
There are 3 ways to select a mask:
 
* left mouse click inside polygon
 
* left mouse click inside polygon
 
* use rubberband around polygon, this works only when the active polygon has no selected points
 
* use rubberband around polygon, this works only when the active polygon has no selected points
* use the listbox on the left side
+
* click on the polygon in the listbox on the left
  
=== Selecting point(s) ===
+
== De-selecting a mask ==
 +
 
 +
Click somewhere not on the mask's row in the listbox on the left.
 +
 
 +
== Selecting point(s) ==
 +
 
 +
Note that Hugin uses some "fuzzy" logic when working with mask points. If your masks get too small, you may see some unusual behavior when editing masks. Since masks do not have to be extremely precise, this should not cause any major problems, but it is good to keep in mind.
  
 
You can select points of the active polygon by clicking on it. To select several points use a rubberband around all points. When holding down the shift key, the newly selected points are added to the existing selection.
 
You can select points of the active polygon by clicking on it. To select several points use a rubberband around all points. When holding down the shift key, the newly selected points are added to the existing selection.
  
=== Move point(s) ===
+
== De-selecting point(s) ==
 +
 
 +
Click in the image away from the mask, or re-click on the mask in the listbox on the left side. The mask will remain selected, but individual points will not be.
 +
 
 +
== Moving point(s) ==
 +
 
 +
To move a point, simply drag it after clicking on it with the left mouse button. This also works when more then one point is selected.
 +
 
 +
== Moving the whole mask ==
 +
 
 +
If you want to move the whole mask, drag from within the mask with the right mouse button.
 +
 
 +
== Adding points ==
 +
 
 +
You can add a new point to the mask polygon by clicking on a line segment with left mouse button while holding down the control key (command on a Mac). Until you release the left mouse button, you can also directly move the newly created point.
 +
 
 +
== Deleting points ==
 +
 
 +
You can delete a single point of the active polygon by a right mouse click while holding down the control key (command on a Mac) on a point. To delete multiple points drag a rectangle/rubberband with the right mouse button while holding down the control key (command on a Mac) around the points. When you press the delete key the selected points are deleted.
 +
 
 +
Note that if the remaining polygon would consists of fewer than three points, the delete operation is canceled.
 +
 
 +
= Cropping images =
 +
''Image cropping'' shouldn't be confused with a camera's [[Crop factor]], which is something else entirely. Use the '''Crop''' tab to indicate the areas of the input images that [[hugin]] should exclude from the stitching output. There are three situations where you might want to use crop parameters:
 +
* With a scanned input image, there are usually black edges or marks along the sides of the image.
 +
* With a circular [[Fisheye Projection]] image there are black unexposed areas outside the image circle.
 +
* Some lenses have a lot of flaring around the edges which you don't want to keep.
 +
 
 +
Select the image to be cropped in the list to the left, you can adjust the position of the crop area by dragging the perimeter in the image preview on the right.  Multiple images can be selected by holding down the ''Shift'' or ''Ctrl'' keys while clicking in the image list.
 +
 
 +
Note that unlike [[PTGui]], setting [[crop parameters]] in hugin doesn't change the [[Field of View]] or optical centre of your images, it simply indicates areas of the image to be masked out, so you can change the cropping for photos in your project at any stage of the stitching process.
 +
In detail, [[hugin]] uses the '''S''' 'selection' parameter in the '''i''' and '''o''' script lines instead of the '''C''' 'crop' parameter.
  
Simply drag a point with left mouse button. This works also when more then one point is selected.
+
Depending on the input image type, cropping has two different behaviours:
 +
* For circular fisheye photos the crop area is a circle.
 +
* For any other input image, the crop area is a rectangle.
 +
Change the input image type in the [[Hugin Photos tab]] or in the [[Hugin Assistant tab]].
  
=== Move whole mask ===
+
The '''Crop''' tab features four text boxes for '''Left''', '''Top''', '''Right''' and '''Bottom''' where you can manually enter the positions of the four edges.  The origin is top-left and numbers indicate the distance in pixels from this origin.
  
If you want to move the whole mask, drag the mask with right mouse button. (You have to start dragging inside the polygon.)
+
Note that numbers can be negative and can extend beyond the width and height of the photo, this is primarily useful for partial fisheye images where the full circle is not visible, in this case the crop circle extends beyond the picture frame.
  
=== Adding points ===
+
The default '''Always center Crop on d,e''' assumes that all cropping is symmetrical around the optical centre of the lens.  This is normal unless you are using the crop feature to remove lens flare, in which case the crop may need to be asymmetrical.
  
You can add a new point to the mask polygon by click with left mouse button while holding down the ctrl key on a line segment. Until you release the left mouse button you can also directly move the newly created point.
+
The '''d''' and '''e''' lens parameters setting the position of the optical centre are used by the [[Lens correction model]] and are set in the [[Hugin Photos tab]].
  
=== Deleting points ===
+
== Save and apply crop values ==
 +
Usually crop values don't vary too much for each lens/camera combination. So instead of always creating an almost same crop for new projects these values can be saved using the 'Save lens...' button in the [[Hugin Photos tab]] tab.
  
You can delete a single point of the active polygon by a right mouse click while holding ctrl key on a point. To delete multiple points drag a rectangle/rubberband with the right mouse button and pressed ctrl key around the points, which should be deleted. When you press the delete key the selected points are deleted.
+
To load crop values just select one image in the 'Camera and Lens' tab and load the previously saved lens description file. That also sets the crop for all images in the project that have the same lens number.  
  
Attention: When the remaining polygon consists of less than tree points, the delete operation is canceled.  
+
The lens description file is a plain text file with a .ini extension.
  
  

Latest revision as of 19:25, 23 October 2014

Contents

[edit] Hugin Masks tab

The Hugin Masks tab has two functions:

  • Creating masks for individual images that include or exclude specific parts of these individual images in your final panorama.
  • Cropping one or more of your individual images, as you would do for, e.g., fisheye Projection images having a circular area in the middle with a useless black area outside, or scanned images that might have edges that need to be cropped away.

The top-left side of the masks window shows a list of all images in the current project.

The Masks tab has in the mid-section on the left side two sub-tabs Masks and Crop, each with its own functionality. Note that you have to select an image in the top left before the functionality of both will be enabled.

[edit] Editing masks

The blender (default is Enblend) may place a seam on any part of the overlap between photos. This can result in a person or object being cut by the seam and only partly appearing in the final stitch. Blend masking allows you to define an include region which the blender will try to incorporate into the final stitch, as well as an exclude region which the blender will try to keep out of the stitch.

Blend masks are not like normal "cut and paste" masking. They are more like hints for the blender. Therefore it is not always necessary to carefully define a mask exactly on the boundary of an object. Often it sufficient to roughly enclose the area to be included or excluded. Be careful to exclude a part of one photo only if some other photo shows the same part of the scene, otherwise you will get a black empty area in your final panorama.

Note that control points inside an exclude mask are still used in optimization.

Masks can be saved and reloaded.

The top-left side of the masks window shows a list of all images in the current project. The listbox below shows all masks of the active image.

[edit] Creating a mask polygon

After selecting add new mask set polygon points with left mouse click. Finish polygon with right mouse button click or double left click.

[edit] Deleting a mask

You can delete the active mask by selecting it and clicking the Delete mask button by the listbox on the left. You can also use your delete key when all or none of the points of the current mask are selected.

[edit] Selecting a mask

There are 3 ways to select a mask:

  • left mouse click inside polygon
  • use rubberband around polygon, this works only when the active polygon has no selected points
  • click on the polygon in the listbox on the left

[edit] De-selecting a mask

Click somewhere not on the mask's row in the listbox on the left.

[edit] Selecting point(s)

Note that Hugin uses some "fuzzy" logic when working with mask points. If your masks get too small, you may see some unusual behavior when editing masks. Since masks do not have to be extremely precise, this should not cause any major problems, but it is good to keep in mind.

You can select points of the active polygon by clicking on it. To select several points use a rubberband around all points. When holding down the shift key, the newly selected points are added to the existing selection.

[edit] De-selecting point(s)

Click in the image away from the mask, or re-click on the mask in the listbox on the left side. The mask will remain selected, but individual points will not be.

[edit] Moving point(s)

To move a point, simply drag it after clicking on it with the left mouse button. This also works when more then one point is selected.

[edit] Moving the whole mask

If you want to move the whole mask, drag from within the mask with the right mouse button.

[edit] Adding points

You can add a new point to the mask polygon by clicking on a line segment with left mouse button while holding down the control key (command on a Mac). Until you release the left mouse button, you can also directly move the newly created point.

[edit] Deleting points

You can delete a single point of the active polygon by a right mouse click while holding down the control key (command on a Mac) on a point. To delete multiple points drag a rectangle/rubberband with the right mouse button while holding down the control key (command on a Mac) around the points. When you press the delete key the selected points are deleted.

Note that if the remaining polygon would consists of fewer than three points, the delete operation is canceled.

[edit] Cropping images

Image cropping shouldn't be confused with a camera's Crop factor, which is something else entirely. Use the Crop tab to indicate the areas of the input images that hugin should exclude from the stitching output. There are three situations where you might want to use crop parameters:

  • With a scanned input image, there are usually black edges or marks along the sides of the image.
  • With a circular Fisheye Projection image there are black unexposed areas outside the image circle.
  • Some lenses have a lot of flaring around the edges which you don't want to keep.

Select the image to be cropped in the list to the left, you can adjust the position of the crop area by dragging the perimeter in the image preview on the right. Multiple images can be selected by holding down the Shift or Ctrl keys while clicking in the image list.

Note that unlike PTGui, setting crop parameters in hugin doesn't change the Field of View or optical centre of your images, it simply indicates areas of the image to be masked out, so you can change the cropping for photos in your project at any stage of the stitching process. In detail, hugin uses the S 'selection' parameter in the i and o script lines instead of the C 'crop' parameter.

Depending on the input image type, cropping has two different behaviours:

  • For circular fisheye photos the crop area is a circle.
  • For any other input image, the crop area is a rectangle.

Change the input image type in the Hugin Photos tab or in the Hugin Assistant tab.

The Crop tab features four text boxes for Left, Top, Right and Bottom where you can manually enter the positions of the four edges. The origin is top-left and numbers indicate the distance in pixels from this origin.

Note that numbers can be negative and can extend beyond the width and height of the photo, this is primarily useful for partial fisheye images where the full circle is not visible, in this case the crop circle extends beyond the picture frame.

The default Always center Crop on d,e assumes that all cropping is symmetrical around the optical centre of the lens. This is normal unless you are using the crop feature to remove lens flare, in which case the crop may need to be asymmetrical.

The d and e lens parameters setting the position of the optical centre are used by the Lens correction model and are set in the Hugin Photos tab.

[edit] Save and apply crop values

Usually crop values don't vary too much for each lens/camera combination. So instead of always creating an almost same crop for new projects these values can be saved using the 'Save lens...' button in the Hugin Photos tab tab.

To load crop values just select one image in the 'Camera and Lens' tab and load the previously saved lens description file. That also sets the crop for all images in the project that have the same lens number.

The lens description file is a plain text file with a .ini extension.


Hint: On Mac OS use the command key instead of the control key for all above mentioned operations.

Personal tools
Namespaces

Variants
Actions
Navigation
tools
Tools