1 / 23

計算攝影 學 Final Project 影像縮放內 插法 on MFC 介面

計算攝影 學 Final Project 影像縮放內 插法 on MFC 介面. Outline. Project 說明 最近 相鄰內插法 (nearest-neighbor interpolation ) 立方 內 插法 (cubic interpolation ) 線性 內 插法 (linear interpolation) MFC 介面簡介 速度分析比較 DEMO 應用. Project 說明.

akiko
Download Presentation

計算攝影 學 Final Project 影像縮放內 插法 on MFC 介面

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 計算攝影學 Final Project 影像縮放內插法 on MFC介面

  2. Outline • Project 說明 • 最近相鄰內插法(nearest-neighbor interpolation) • 立方內插法(cubic interpolation) • 線性內插法(linear interpolation) • MFC介面簡介 • 速度分析比較 • DEMO • 應用

  3. Project 說明 • 由程式載入一張256x256的影像,再由外部輸入任意一個倍數的長寬大小,將原圖依照輸入比例放大或縮小,放大縮小的演算法分別使用Linear與cubic的內插,並且比較花費時間與影像品質。

  4. Project 說明 • 程式在得知輸入的放大或縮小倍數後,要先利用迴圈算出輸出影像每個pixels所對應到原始影像上的位置,由於放大或是縮小不一定是整數倍,所以算出的位置可能會有小數點,因此依照下面不同的演算法,以不同的參考點與權重來求得輸出影像點pixels的數值。

  5. 256256 MM (X’,Y’) (X,Y) 放大 NN 256256 縮小 Project 說明 • 例如:下圖放大MxM後的(X,Y)點,可以經過運算後對應到原圖256x256上的(X’,Y’)座標。

  6. 最近相鄰內插法(nearest-neighbor interpolation) • 最近相鄰內插法(nearest-neighbor interpolation) • 定義 • 從目的影像推回原始影像時,產生像素無值的情況 • 藉由四個相鄰近的點來求出新值 • 作法 • 選擇一個最接近距離整數位置的像素填上

  7. 最近相鄰內插法(nearest-neighbor interpolation) • 若與多個鄰近點距離相同 • 任選其一為其像素值 • 將非整數座標四捨五入後取該點像素值 • 改變距離的計算方式

  8. 立方內插法(cubic interpolation) 1-D立方內插法是參考最近的四個點為參考點,依照所算出的x'座標與四點的距離關係依照R3(u)得到權重,再將權重分別乘以參考點數值相加,即可算出。而權重的算法會因為距離不同,而有不同的算法。

  9. 線性內插法(linear interpolation) 1-D線性內插法是參考最近的兩個點為參考點,依照所算出的F座標與兩點的距離關係得到權重 ,再將權重分別乘以參考點數值相加,即可算出。

  10. MFC類別函式庫 • MFC類別函式庫 • MFC(Microsoft Foundation Class Library)是一套整合在VC++中供開發視窗程式用的類別函式庫,提供了豐富的類別函式供程式設計師來開發各類的視窗應用程式。

  11. MFC類別函式庫 • 使用MFC開發視窗程式的優點 • 一、程式架構簡單 • 二、各類別功能涵蓋範圍廣 • 三、簡化使用Windows API來開發程式的難度

  12. MFC類別函式庫 • 視窗程式開發兩種架構 • 一、使用Windows API • 二、使用MFC • 使用MFC來開發程式比較簡單,並且在MFC程式中亦可直接呼叫使用Windows API中的函式。 • 不過在程式的執行效能上,使用Windows API所開發出的程式在執行速度上則會比較快,對於講求執行速度的程式,如遊戲程式,通常會以Windows API來做為程式開發的基礎。 Windows API MFC 應用程式

  13. 結果比較 內插演算法花費時間比較表 (時間不包括載入原始影像與輸出影像,只有演算法部分)

  14. 結果比較 1-D linear interpolation(線性內插法)

  15. 結果比較 1-D cubic interpolation(立方內插法) 1-D cubic interpolation影像較圓滑,鋸齒狀沒那麼明顯

  16. 結果比較 nearest-neighbor interpolation(鄰近內插法)

  17. 結果比較 cubic linear nearest

  18. DEMO 連結 DEMO影片 http://www.youtube.com/watch?v=kzGDtwHLd38

  19. 應用The Laplacian Pyramid as a CompactImage Code • The encoding process is equivalent to sampling the image with Laplacian operators of many scales. • Thus, the code tends to enhance • salient image features. P. Burt and T. Adelson. The Laplacian Pyramid as a Compact Image Code. IEEE Transactions on Communication, COM-31:532–540, 1983.

  20. 應用The Laplacian Pyramid as a CompactImage Code P. Burt and T. Adelson. The Laplacian Pyramid as a Compact Image Code. IEEE Transactions on Communication, COM-31:532–540, 1983.

  21. 應用The Laplacian Pyramid as a Compact Image Code 可以簡化影像融合時的運算,只須對金字塔中每一層的資訊利用簡單的混和係數進行縫合,就可以經由重建過程中使用的濾波器擴大效應 P. Burt and T. Adelson. The Laplacian Pyramid as a Compact Image Code. IEEE Transactions on Communication, COM-31:532–540, 1983.

  22. 應用 加快運算時間 如:Laplacian Pyramid Ref:1983_IEEE_The Laplacian Pyramid as a Compact Image Code 影像品質提升 如:Bilsteral Grid Ref:2007_ACM_Real-time Edge-Aware Image Processing with the Bilateral Grid 影像細節保留 Ref :2007_ACM_Detail preserving shape deformation in image editing

  23. The End

More Related