alanhc
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # VFX Project2 ## Members #### R10922017 許博翔 #### R10944007 曾宏鈞 ## Implemetation 0. Taking Photo 1. Image Warping 2. Feature Detection –– Harris 3. Feature Description –– SIFT 4. Feature Matching 5. Image Stiching ### 0. 使用腳架定點旋轉拍照 ![](https://i.imgur.com/Vp3esqa.png) ### 1. Image Warping 將原始圖像的座標x, y,投影到圓柱上,得到圓柱座標theta, h,產生warp的影像。 實作上從圓柱對應到原始影像取值,投影後的影像高度與原始影像相同,寬度則是弧長(focal_len * theta)。 ![](https://i.imgur.com/MplBR6J.png) ### 2. Feature Detection 1. 利用 Harris Corner Detection Algorithm 找到 corner response R 及 orientation。 - R: 求 $R=detM-k(trace M)^{2}$ 1. 輸入灰階圖片 $I_{gray}$ 2. 透過Scharr kernel求出x及y方向的derivative dx、dy 3. 計算$I_{xx}$、$I_{yy}$、$I_{xy}$ ($I_{xy}=dx*dy$) 4. 透過GaussianBlur求出$S_{xx}$ 5. 帶入下面式子求出 $detM$、$traceM$ $$M= \begin{pmatrix} S_{xx} & S_{xy} \\ S_{yx} & S_{yy} \end{pmatrix} $$ - orientation: 透過前面計算過的dx, dy計算$arctan2(dx,dy)$ 2. 將對比度較低的點移除 - 首先使用Laplacian Filter,讓比四周還大的值更大;和四周差不多的變小 - 設定threshold挑選部分點作為特徵點。 ![](https://i.imgur.com/UKHZljt.png) ### 3. Feature Description 實作 SIFT Algorithm 將每個 keypoint 周圍 16 x 16 的 pixel 分成 4 x 4 的 grids,然後每個 grid 中 的 16 個 pixel 根據 gradient 的大小作為權重,統計成每 45 度角為一組的 histogram,最後得到 128 維的 descriptors ### 4. Feature Matching - 取相鄰兩相片 $I_{i}$ 、 $I_{i+1}$ ,利用 KDTree 找出 $I_{i+1}$ 上每個特徵點在 $I_{i}$ 上 discriptor 最接近的兩個特徵點。 - 若 $I_{i+1}$ 上一個特徵點和 $I_{i}$ 上找到的兩個最接近的特徵點 discriptor 距離差不多(相除 < 0.8),則移除該 match 。反之,與距離小者作為一個 match。 ### 5. Image Stiching - 首先使用 `estimateAffinePartial2D()` 計算兩張圖片拼接最適當的距離,其中該函式會使用 RANSAC 演算法消除 outlier ,避免誤差。 - 接著計算頭尾兩張圖垂直方向的 shift ,透過調整所有圖片 shift 的方式,讓拼接結果較不會歪掉。 - 最後算出輸出大小,把圖片一張一張貼上去,利用 $1-(\frac{d}{D})^2$ 的方式,將重疊部分做 blending。 ## Results ### Testing Data ![](https://i.imgur.com/1olV3fX.jpg) ### Ours (focal length 1200) ![](https://i.imgur.com/LtNfSGD.jpg) ## Discussion ### 過濾太多餘的特徵點 一開始實作完 Harris Corner Detection 之後,我們發現取得的特徵點數量非常多,而且有很多幾乎黏在一起,但這會讓計算時間變更多,因此我們找到了 Laplacian 這個 filter ,它會每個 pixel 和四周的差加起來,如果算出來是正的,代表這個 pixel 可能比四周都還大,這樣就能做出 local maximun 的效果,來過濾一些不必要的特徵點。 ### 避免 accumlated error 就像老師上課提到的,隨著圖片一張一張拼接,有可能會因為垂直方向上的誤差,讓拼出來的結果斜斜地往上或往下拼,為了避免這種狀況,我們計算了頭尾兩張圖的垂直偏差,把它分散到所有圖片,這樣一來就能拼出較方正的結果了。 ### 拍攝照片亮度不一 我們在拍攝照片之後,才發現相機選到了自動模式,因此每張照片的f值和曝光時間都不太一樣。後來我們利用 $\mathrm{EV}=\log _{2} \frac{f值^{2}}{曝光時間}$ 的公式,把每張照片的曝光都調成一樣之後,再進行拼接。 ## 參考資料 1. https://github.com/tsai-you-shin/Image-stitching 2. https://docs.opencv.org/4.x/d1/de0/tutorial_py_feature_homography.html

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully