2008年12月5日 星期五

用 hugin 接合多張掃描圖檔

不知道用什麼 keyword 比較適當, search 找到的大多是接合全景圖的方案. 若是全景接合, autostitch 簡單易用, 效果又不錯.

若是一般的平面圖檔接合, 目前只有找到 hugin 比較合用. Hugin tutorial — Stitching flat scanned images 這篇有教學, 配合 0.7.0 版的 hugin, 我的經驗跟步驟如下:
  1. 先用其他軟體將 image 轉成相同方向, 否則沒辦法讓程式自動產生 control point. 同向就可以了, 不用轉正.
  2. 在 image tab, add individual images, 載入全部的 image, HFOV 填 10.
  3. 按 "create control points", 讓程式自動產生 control point
  4. 簡單看一下 control point, 若是掃描文件, 比較容易有錯, delete 掉錯的點
  5. 如果圖都是歪的, 自己增加 control point, type 選 horizontal 或 vertical line
  6. 對比較正/比較好的 image 設 anchor reference, "anchor this image for position", "anchor this image for exposure"
  7. 在 camera and lens tab, 在每張 image 上按 new lens, 確定 "lens no." 都不一樣
  8. 在 optimizer tab, 選 custom parameter, 勾 reference image 之外的 v, d, e.
  9. 比較不歪的當基準, 勾其他的 r. 若都是歪的, 前面設了 control point, 那就全勾.
  10. 按 "optimize now", apply
  11. 在 stitcher tab, projection 選 rectilinear. 按 "calculate field of view", "calculate optimal size". output 選 jpeg, quality 85
  12. ctrl-p preview, 調整一下 center 跟 h-fov, v-fov
  13. "Stitch now"