From: <hug...@li...> - 2010-11-22 22:31:40
|
details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin-web/hgrepo/h/hu/hugin/hugin-web/rev/e10eebe441bb changeset: 212:e10eebe441bb user: Terry Duell <td...@us...> date: Tue Nov 23 09:28:32 2010 +1100 description: Update for mosaic mode diffstat: tutorials/scans/en.shtml | 319 ++++++++++++++++++++-------------------------- 1 files changed, 142 insertions(+), 177 deletions(-) diffs (349 lines): diff -r 5c8064767de0 -r e10eebe441bb tutorials/scans/en.shtml --- a/tutorials/scans/en.shtml Wed Sep 29 21:47:36 2010 +0100 +++ b/tutorials/scans/en.shtml Tue Nov 23 09:28:32 2010 +1100 @@ -2,202 +2,167 @@ <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hugin tutorial — Stitching flat scanned images</title> + -<style media="screen" type="text/css" title="Screen style sheet"> + + + <style media="screen" type="text/css" title="Screen style sheet"> @import url(/css/normal.css); -</style> -<link rel="icon" href="/css/icon.png" type="image/png" /></head><body> + </style> + + <link rel="icon" href="/css/icon.png" type="image/png" /></head><body> <!--#include virtual="/ssi/menu.html"--> <div class="content"> <h1>Hugin tutorial — Stitching flat scanned images</h1> - <p><strong>This tutorial covers another non-panoramic usage of Hugin — Taking two or more partial scanned images of a large object, such as an LP cover, map or poster, and stitching them seamlessly into a single final image.</strong></p> - -<em>Note: This tutorial is based on the March 2005 beta version of Hugin, -although your version may differ, the underlying principle will remain the -same. The rest of this article assumes that you are familiar with <a href="../two-photos/">basic photographic stitching</a> using Hugin.</em> - -<p>Here is a page that is too big to fit in the scanner and has to be scanned -in two parts. These can be assembled in the gimp, but each scan is rotated +<em>Note: This tutorial is based on the 2010.2.0 version of Hugin, +although your version may differ, the underlying principle will remain +the +same. The rest of this article assumes that you are familiar with <a href="../two-photos/">basic photographic stitching</a> using Hugin.</em> +<p>Here is a page that is too big to fit in the scanner and has to be +scanned +in two parts. These can be assembled in the gimp, but each scan is +rotated differently and it is nearly impossible to line them up.</p> - <p><a href="scan-1.jpg"><img alt="top part of scan" src="scan-1-small.jpg" /></a> <a href="scan-2.jpg"><img alt="bottom part of scan" src="scan-2-small.jpg" /></a></p> - -<p>The solution is to use <a href="http://hugin.sourceforge.net/">Hugin</a> and <a href="http://panotools.sourceforge.net/">Panorama Tools</a> to rotate and align the +<p>The solution is to use <a href="http://hugin.sourceforge.net/">Hugin</a> +and <a href="http://panotools.sourceforge.net/">Panorama Tools</a> to +rotate and align the pieces perfectly.</p> - -<p>Start by launching Hugin, use the <big><strong>Add individual -images..</strong></big> button to select the scanned images you want to +<p>Start by launching Hugin, use the <big><strong>Assistant 1. Load +images..</strong></big> button and select the scanned images you want +to assemble.</p> - -<p><img alt="Images tab" src="shot-01.jpg" /></p> - -<p>Switch to the <big><strong>Camera and Lens</strong></big> tab.</p> - -<p>Panorama Tools expects images to be photographs taken with a -camera. Obviously this is not the case, but in fact a scanned image +Panorama Tools expects images to be photographs taken with a +camera. Obviously this is not the case, but in fact a scanned image is very similar to a simple <em>Rectilinear</em> photo taken with a 'perfect' camera — A camera with zero <em>pitch</em>, -zero <em>yaw</em> and zero <em>lens distortion</em>.</p> - -<p>We don't know the <em>FOV (Field of view)</em> of this imaginary camera, but +zero <em>yaw</em> and zero <em>lens distortion.<br /> +</em>We don't know the <em>FOV (Field of view)</em> of this imaginary +camera, but it doesn't matter since the picture is the same regardless (setting any -mid-range value between 5 and 40 degrees would probably be ok). Just select an -image and enter <big><strong>10</strong></big> in the <big><strong>degrees of -view (v)</strong></big> text box.</p> - -<p>Our 'perfect' camera doesn't have any lens distortion, so ensure -that each of the <big><strong>a</strong></big>, -<big><strong>b</strong></big> & <big><strong>c</strong></big> -boxes in <big><strong>Lens Correction Parameters</strong></big> are -set to <big><strong>0</strong></big>.</p> - -<p><img alt="Camera and Lens settings tab" src="shot-02.jpg" /></p> - -<p>The output image format is going to be equivalent to yet another -'perfect' <em>rectilinear</em> camera (except with a larger -<em>Field of View</em>), so switch to the -<big><strong>Stitcher</strong></big> tab and change the output -format to say '<big><strong>as a Rectilinear</strong></big> -panorama'. Change the <big><strong>Field of View</strong></big> -setting to something a bit larger than your source images — -Something like <big><strong>40</strong></big> degrees for both -<big><strong>Horizontal (v)</strong></big> and -<big><strong>Vertical</strong></big>.</p> - -<p><em>Tip: don't worry about getting this field-of view exactly -right just yet, Hugin can calculate it for you later.</em></p> - -<p><img alt="Stitcher Tab" src="shot-03.jpg" /></p> - -<p>Switch to the <big><strong>Control points</strong></big> tab. +mid-range value between 5 and 40 degrees would probably be ok). Just +enter <big><strong>10</strong></big> in the <big><strong>HFOV(v):</strong></big> +text box, and select OK. You will have to do this for each image. +<p><img style="width: 800px; height: 663px;" alt="add image" src="shot-1new.jpg" /><br /> +</p> +<br /> +Switch to the <big><strong>Control points</strong></big> tab. Add a series of control points for each pair of images, just as you would when <a href="../two-photos/en.shtml">stitching two photos -together</a>.</p> +together</a>. +<p><em>Tip: You you need at least two control-points per pair of +images, but +more points will allow the optimizer to find a better alignment. I'm +lazy, so +the control points for this tutorial were generated automatically by <strong>autopano-sift-C</strong>.</em></p> +<p><img style="width: 800px; height: 663px;" alt="control points" src="shot-3new.jpg" /><br /> +</p> +Switch to the <big><strong>Camera and Lens</strong></big> +tab.<br /> +<p>You need to stop Hugin from assuming that all the pictures were +taken with +the same camera, so you need to asign a different <em>lens</em> to +each image. +Do this by selecting one picture and hitting the <big><strong>New +lens</strong></big> button. If you have more than two images, set <span style="font-weight: bold;">New lens</span> for all the images, such +that each image has a different lens number.<br /> +</p> +<p><img style="width: 800px; height: 662px;" alt="new lens" src="shot-4new.jpg" /><br /> +</p> +<p>Now select the <big><strong>Optimizer</strong></big> tab. We are +not doing a standard panorama. For this project we can use the Mosaic mode, so change the +<big><strong>Optimize</strong></big> setting to <big><strong>The Custom parameters below </strong></big>and then set <span style="font-weight: bold;">r,X,Y,Z</span> for all images other than the anchor image, select <big><strong>Optimize +now!</strong></big></p>Note, that you could also optimize by setting r,v,d,e for all images other than the anchor.<br /> +<p><img style="width: 800px; height: 548px;" alt="optimise" src="shot-5anew.jpg" /><br /> +</p> -<p><em>Tip: You you need at least two control-points per pair of images, but -more points will allow the optimizer to find a better alignment. I'm lazy, so -the control points for this tutorial were generated automatically by <strong>autopano-sift</strong>.</em></p> +<p>When it is done you will need to +<big><strong>Apply</strong></big> the changes.</p> +<p>Now is a good time to use the<span style="font-weight: bold;"><big> +Fast</big> </span><big><strong>Preview +Window</strong></big> to check that everything is going to be ok. <br /> +</p> +<p><img style="width: 800px; height: 765px;" alt="fast preview" src="shot-6new.jpg" /><br /> +</p> +<p>Select <span style="font-weight: bold;">Projection</span> and set +to <span style="font-weight: bold;">rectlinear</span>, then drag the +window sliders to set suitable fields of view. <br /> +</p> +<p>Select <span style="font-weight: bold;">Move/Drag</span> to +position the image using <span style="font-weight: bold;">Mosaic mode</span>, +and then select <span style="font-weight: bold;">Crop</span> and drag +the inside of the cropping rectangle to adjust the crop. <br /> +</p> +<p>That's it, you can use the <big><strong>Stitcher</strong></big> +tab to create a permanent output file as usual.<br /> +In the <span style="font-weight: bold;">Stitcher</span> tab select <span style="font-weight: bold;">calculate Optimal Size</span>, set your +outputs and then <span style="font-weight: bold;">Stitch Now...</span></p> +<span style="font-weight: bold;"> +<p><span style="font-weight: normal;">We have used <span style="font-style: italic;">Calculate Optimal +Size</span> for this example because the images have been scanned from printed +material and the optimal size will minimize any pattern effects that +might occur if the resulting stitch is scaled down.</span><br /> +</p> +<p><img style="width: 800px; height: 666px;" alt="stitch" src="shot-7new.jpg" /><br /> +</p> +<h2>Advanced techniques</h2> +</span> +<p>Other things you might want to experiment with are:</p> +<ul> + <li> + <p>Rotational alignment — Horizontal and vertical control points +can be +used to get the overall rotation perfect. See <a href="../architectural/">other tutorials</a> for tips on using these +types of +control points.</p> + </li> + <li> + <p>You are not limited to stitching two scans at a time, you can +assemble +as many as you like in single or multiple rows.</p> + </li> + <li> + <p>A similar method can be used to stitch photos of a surface taken +from +different viewpoints and distances (such as a mural), this is a subject +for a + <a href="../">future tutorial</a>.</p> + <p>Tip: All lens distortion needs to be +corrected beforehand, as <em>d</em> and <em>e</em> parameters +interfere with +the <em>a</em>, <em>b</em> and <em>c</em> lens correction parameters.</p> + </li> +</ul> +<p>Below is a final version stitched with <em>nona</em> and <em>enblend</em>. +There has been no manual re-touching, +however the join is completely invisible.</p> +<span style="font-weight: bold;"> +<p><a href="leaves-from-nature-no1.jpg"><img alt="Leaves from Nature No.1" src="leaves-from-nature-no1-small.jpg" /></a></p> +<h2>About this picture</h2> +</span><span style="font-weight: bold;"> +<p style="font-weight: normal;">The <em>Grammar of Ornament</em> by +Owen Jones, was published in 1856 and is +a landmark of Victorian architecture, printing and design. The final +chapter; +<em>Leaves and flowers from nature</em> was extremely influential in +the +development of the <a href="http://en.wikipedia.org/wiki/Arts_and_Crafts_movement">Arts and +crafts</a> and <a href="http://en.wikipedia.org/wiki/Art_nouveau">Art +Nouveau</a> +movements.</p> +<p><span style="font-weight: normal;">Author </span><a style="font-weight: normal;" href="mailto:br...@po...">Bruno +Postle</a><span style="font-weight: normal;"> - +Created March 2005. Updated May 2005. <br /> +</span></p> +<p><span style="font-weight: normal;">Updated for Hugin 2010.2, Nov 2010 by Terry +Duell</span><b><br /> + </b></p> -<p><img alt="Control points set" src="shot-04.jpg" /></p> +</span></div> -<p>The plan is to use one image as an 'anchor'. This image will -stay in place and the other images will be rotated, scaled and moved -by the optimizer until they align perfectly.</p> - -<p>In Panorama Tools terminology, rotation is equivalent to -<em>Roll</em>, scaling is equivalent to <em>Field of View</em> and -movement is equivalent to <em>d</em> & <em>e</em> lens shift -parameters.</p> - -<p>Switch back to the <big><strong>Camera and Lens</strong></big> -tab and tell Hugin that these parameters are going to be different -for all of your source images. Do this by 'unchecking' the -<big><strong>Inherit</strong></big> 'checkbox' for each of -<big><strong>degrees of view (v)</strong></big>, -<big><strong>horizontal (d)</strong></big> and -<big><strong>vertical (e)</strong></big>.</p> - -<p>You need to stop Hugin from assuming that all the pictures were taken with -the same camera, so you need to asign a different <em>lens</em> to each image. -Do this by selecting each picture in turn and hitting the <big><strong>New -lens</strong></big> button for each.</p> - -<p><img alt="Camera and Lens tab" src="shot-05.jpg" /></p> - -<p>Now select the <big><strong>Optimizer</strong></big> tab. We are -not doing a standard panorama, so change the -<big><strong>Optimize</strong></big> setting to <big><strong>the -Custom parameters below</strong></big></p> - -<p>You need to optimize <big><strong>roll(r)</strong></big>, -<big><strong>fov(v)</strong></big>, <big><strong>d</strong></big> and -<big><strong>e</strong></big> for all images except the anchor. Make sure that -you are <em>not</em> optimizing any <em>pitch</em>, <em>yaw</em>, <em>a</em>, -<em>b</em> or <em>c</em> parameters.<!-- The next step involves tweaking the -optimizer script itself, so make sure you 'check' <big><strong>Edit script -before optimizing</strong></big>. --></p> - -<p><img alt="Optimizer Tab settings" src="shot-06.jpg" /></p> - -<p>Hit the <big><strong>Optimize now!</strong></big> button <!-- and you will be -presented with a Panorama Tools script file to edit.</p> - -<p>Image <em>0</em> is your anchor image, so you don't want Panorama Tools to -optimize anything to do with Image <em>0</em>. So find the 'v' lines and -delete the whole line that tells Panorama Tools to optimize <em>d</em>, -<em>e</em> and <em>v</em> for Image <em>0</em> (i.e. delete the line that says -<big><strong>v d0 e0 v0</strong></big>).</p> - -<p><img alt="Edit panorama tools script" src="shot-07.jpg" /></p> <p>Click -<big><strong>Continue with these changes</strong></big> --> and wait while Panorama -Tools tries to find a good fit. When it is done you will need to -<big><strong>Apply</strong></big> the changes.</p> - -<p>Now is a good time to use the <big><strong>Preview -Window</strong></big> to check that everything is going to be ok -(press the <big><strong>Ctrl P</strong></big> combination to launch -the preview window).</p> - -<p><em>Tip: Hit the <big><strong>Fit</strong></big> button in the -preview to resize the output image to fit the combined input -images.</em></p> - -<p><img alt="Preview" src="shot-08.jpg" /></p> - -<p>That's it, you can use the <big><strong>Stitcher</strong></big> -tab to create a permanent output file as usual.</p> - -<h2>Advanced techniques</h2> - -<p>Other things you might want to experiment with are:</p> - -<ul> - -<li><p>Rotational alignment — Horizontal and vertical control points can be -used to get the overall rotation perfect. See <a href="../architectural/">other tutorials</a> for tips on using these types of -control points.</p><p>Note: you will need to optimise <em>roll</em> (rotation) for -all images including the anchor.</p></li> - -<li><p>Image shearing — Most scanners produce some amount of shear -distortion (racking), especially if they have been knocked. You can experiment -with <em>g</em> or <em>t</em> shear parameters in conjunction with both -horizontal and vertical control points to correct this distortion.</p><p>Note that -there is no point setting both <em>g</em> and <em>t</em> shear parameters at -the same time. For most scanners a portrait oriented scan produces <em>t</em> -distortion.</p></li> - -<li><p>You are not limited to stitching two scans at a time, you can assemble -as many as you like in single or multiple rows.</p></li> - -<li><p>A similar method can be used to stitch photos of a surface taken from -different viewpoints and distances (such as a mural), this is the subject <a href="../Mosaic-mode">another tutorial</a>.</p><p>Tip: All lens distortion needs to be -corrected beforehand, as <em>d</em> and <em>e</em> parameters interfere with -the <em>a</em>, <em>b</em> and <em>c</em> lens correction parameters.</p></li> - -</ul> - -<p>Below is a final version stitched with <em>nona</em> and <em>enblend</em>, -then cropped with the gimp. There has been no manual re-touching, -however the join is completely invisible.</p> - -<p><a href="leaves-from-nature-no1.jpg"><img alt="Leaves from Nature No.1" src="leaves-from-nature-no1-small.jpg" /></a></p> - -<h2>About this picture</h2> - -<p>The <em>Grammar of Ornament</em> by Owen Jones, was published in 1856 and is -a landmark of Victorian architecture, printing and design. The final chapter; -<em>Leaves and flowers from nature</em> was extremely influential in the -development of the <a href="http://en.wikipedia.org/wiki/Arts_and_Crafts_movement">Arts and -crafts</a> and <a href="http://en.wikipedia.org/wiki/Art_nouveau">Art Nouveau</a> -movements.</p> - -<p>Author <a href="mailto:br...@po...">Bruno Postle</a> - -Created March 2005. Updated May 2005</p> - -</div> -</body></html> \ No newline at end of file +</body></html> |