![基于塊的全搜索運動估計算法實現(xiàn)實驗報告(共10頁)_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/27/f16e4c15-1fd9-4e3c-8026-4f6f7924291b/f16e4c15-1fd9-4e3c-8026-4f6f7924291b1.gif)
![基于塊的全搜索運動估計算法實現(xiàn)實驗報告(共10頁)_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/27/f16e4c15-1fd9-4e3c-8026-4f6f7924291b/f16e4c15-1fd9-4e3c-8026-4f6f7924291b2.gif)
![基于塊的全搜索運動估計算法實現(xiàn)實驗報告(共10頁)_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/27/f16e4c15-1fd9-4e3c-8026-4f6f7924291b/f16e4c15-1fd9-4e3c-8026-4f6f7924291b3.gif)
![基于塊的全搜索運動估計算法實現(xiàn)實驗報告(共10頁)_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/27/f16e4c15-1fd9-4e3c-8026-4f6f7924291b/f16e4c15-1fd9-4e3c-8026-4f6f7924291b4.gif)
![基于塊的全搜索運動估計算法實現(xiàn)實驗報告(共10頁)_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/27/f16e4c15-1fd9-4e3c-8026-4f6f7924291b/f16e4c15-1fd9-4e3c-8026-4f6f7924291b5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上數(shù)字視頻處理實驗報告學 院: 通信與信息工程學院系 班: 電信科0901班姓 名: 學 號: 時 間: 2012 年11月23號一、實驗名稱:基于塊的全搜索運動估計算法實現(xiàn)二、實驗?zāi)康模?、掌握運動估計算法的實現(xiàn)原理。2、掌握運動估計算法的研究現(xiàn)狀及多種計算方法。3、學習基于塊的全搜索運動估計算法,研究分析其Matlab實現(xiàn)程序過程,并補充完成程序,對實驗結(jié)果進行分析比較。 三、實驗要求三、實驗要求1、 對實驗程序motionEstAnalysis.m進行分析,完成主程序流程圖。函數(shù)流程圖:2、編寫補充完成部分不全程序代碼,調(diào)試程序使其能正確運行(1) motionE
2、stES( )% Computes motion vectors using exhaustive search method(全搜索法計算運動矢量)% Input% imgP : The image for which we want to find motion vectors(當前圖像)% imgI : The reference image(參考圖像)% mbSize : Size of the macroblock(宏塊尺寸)% p : Search parameter (read literature to find what this means)(搜索參數(shù))% Ouput% m
3、otionVect : the motion vectors for each integral macroblock in imgP(當前圖像中每一個積分宏塊的運動矢量)% EScomputations: The average number of points searched for a macroblock(每個宏塊搜索的平均點數(shù))% Written by Aroh Barjatyafunction BlockCenter, motionVect, EScomputations = motionEstES(imgP, imgI, mbSize, p) % 定義函數(shù)文件motionEst
4、ES.m,imgP、 imgI、 mbSize、 p為傳入?yún)?shù),BlockCenter、motionVect、 EScomputations為返回參數(shù)row col = size(imgI); % 將參考圖像的行數(shù)賦值給row,列數(shù)賦值給colblockcenter = zeros(2,row*col/mbSize2);vectors = zeros(2,row*col/mbSize2); % 定義全0的矢量矩陣的大小costs = ones(2*p + 1, 2*p +1) * 65537; % 定義最小絕對差矩陣的大小computations = 0; % 搜索點數(shù)賦初值為0 % we s
5、tart off from the top left of the image(從圖像左上角開始)% we will walk in steps of mbSize(以宏塊尺寸為步長)% for every marcoblock that we look at we will look for% a close match p pixels on the left, right, top and bottom of it (對于每一個宏塊,在它的上下左右找到與搜索參數(shù)p最匹配的像素)mbCount = 1; %搜索的宏塊數(shù)賦初值為1%1為循環(huán)起始值,mbSize為步長值,row-mbSize+
6、1為循環(huán)終止值for i = 1 : mbSize : row-mbSize+1 for j = 1 : mbSize : col-mbSize+1 % the exhaustive search starts here(全搜索開始) % we will evaluate cost for (2p + 1) blocks vertically % and (2p + 1) blocks horizontaly(我們將計算水平方向上(2p + 1)個塊的最小絕對差和垂直方向上(2p + 1)個塊的最小絕對差) % m is row(vertical) index(m為行指數(shù)) % n is co
7、l(horizontal) index(n為列指數(shù)) % this means we are scanning in raster order for m = -p : p %水平方向上位移矢量范圍 for n = -p : p %垂直方向上位移矢量范圍 % 補充下面程序 % row/Vert co-ordinate for ref block (參考塊的行(垂直方向)的范圍) refBlkVer = i+m; % col/Horizontal co-ordinate(參考塊的列(水平方向)的范圍) refBlkHor = j+n; %如果參考塊的行列范圍的任意一個在已經(jīng)搜索過的宏塊之外,則繼
8、續(xù)下一步的搜索 if ( refBlkVer < 1 | refBlkVer+mbSize-1 > row . | refBlkHor < 1 | refBlkHor+mbSize-1 > col) continue; end costs(m+p+1,n+p+1) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), . imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1), mbSize); % 搜索下一個點 computations = computa
9、tions + 1; end end % Now we find the vector where the cost is minimum % and store it . this is what will be passed back.(現(xiàn)在找到有最小絕對差的矢量并存儲它,這就是將被返回的東西) % 補充下面程序 blockcenter(1,mbCount) = i+ mbSize/2-1; blockcenter(2,mbCount) = j+ mbSize/2-1; % finds which macroblock in imgI gave us min Cost(找到參考圖像中最小絕
10、對差的宏塊) dx, dy, min = minCost(costs); % row co-ordinate for the vector(矢量的行集合) vectors(1,mbCount) = dy-p-1; % col co-ordinate for the vector(矢量的列集合) vectors(2,mbCount) = dx-p-1; %搜索下一個宏塊 mbCount = mbCount + 1; costs = ones(2*p + 1, 2*p +1) * 65537; endendBlockCenter = blockcenter;motionVect = vectors
11、; %返回當前圖像中每一個積分宏塊的運動矢量EScomputations = computations/(mbCount - 1); %返回每個宏塊搜索的平均點數(shù) (2) costFuncMAD( )% Computes the Mean Absolute Difference (MAD) for the given two blocks(對給定的兩個塊計算最小絕對差)% Input% currentBlk : The block for which we are finding the MAD(當前塊)% refBlk : the block w.r.t. which the MAD is
12、being computed(參考塊)% n : the side of the two square blocks% Output% cost : The MAD for the two blocks(兩個塊的最小絕對差)% Written by Aroh Barjatya% 定義函數(shù)文件costFuncMAD.m,currentBlk、refBlk、 n為傳入?yún)?shù),cost為返回參數(shù)function cost = costFuncMAD(currentBlk,refBlk, n) % 補充下面程序cost=sum(sum(abs(currentBlk-refBlk)/(n*n); (3)
13、minCost( )% Finds the indices of the cell that holds the minimum cost(找到擁有最小絕對差的點的指數(shù))% Input% costs : The matrix that contains the estimation costs for a macroblock(包含宏塊的估計代價的矩陣)% Output% dx : the motion vector component in columns(列方向上運動矢量組成)% dy : the motion vector component in rows(行方向上運動矢量組成)% W
14、ritten by Aroh Barjatyafunction dx, dy, min = minCost(costs)row, col = size(costs);% we check whether the current value of costs is less then the already present value in min.% If its inded smaller then we swap the min value with the current one and note the indices.% (檢測costs的當前值是否比已經(jīng)出現(xiàn)的最小值小。如果小的話,
15、我們將當前值與最小值對調(diào),并注明指數(shù))% 補充下面程序minnum=65536;x=8;y=8;for i=1:rowfor j=1:colif(costs(i,j)<minnum)minnum=costs(i,j);x=i;y=j;endendenddx=x;dy=y;min=minnum; (4) imgPSNR( )% Computes motion compensated image's PSNR(計算運動補償圖像的峰值信噪比)% Input% imgP : The original image (原始圖像)% imgComp : The compensated image(補償圖像)% n : the peak value possible of any pixel in the images(圖像中任何一個像素的可能的峰值)% Ouput% psnr : The motion compensated image's PSNR(運動補償圖像的峰值信噪比)% Written by Aroh Barjatyafunction psnr = imgPSNR(imgP, imgComp, n)% 補充下面程序MSE=(1/(n*n)*sum(sum(imgP-imgComp).2);PSNR=10*log10(2552/MSE);psnr=PSNR;
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年五股東共同投資協(xié)議文本
- 2025年新型可控氣氛爐項目申請報告模稿
- 2025年醫(yī)療行業(yè)信息共享合同樣式
- 2025年創(chuàng)意企業(yè)合作協(xié)議標準文本
- 2025年分期付款合同服務(wù)全方位指南
- 2025年供應(yīng)商與采購商海鮮交易合同
- 2025年酸堿平衡調(diào)節(jié)藥項目規(guī)劃申請報告
- 2025年廢棄土地資源化合同
- 2025年專利申請買賣雙方協(xié)議
- 2025年人才選拔與委托合作協(xié)議標準文本
- 2025年陜西延長石油集團礦業(yè)公司招聘筆試參考題庫含答案解析
- 2025中國煙草/中煙工業(yè)招聘易考易錯模擬試題(共500題)試卷后附參考答案
- 2025至2030年中國PVC熱縮封帽數(shù)據(jù)監(jiān)測研究報告
- 2025年遼寧農(nóng)業(yè)職業(yè)技術(shù)學院高職單招高職單招英語2016-2024年參考題庫含答案解析
- 《教育強國建設(shè)規(guī)劃綱要(2024-2035年)》解讀與培訓
- 老年髖部骨折患者圍術(shù)期下肢深靜脈血栓基礎(chǔ)預防專家共識(2024版)解讀 課件
- 三年級上冊豎式計算練習300題及答案
- 加速器控制 中國科學技術(shù)大學國家同步輻射實驗室
- 民事庭審筆錄
- 《安全監(jiān)理上崗培訓》PPT課件.ppt
- 青島海洋地質(zhì)研究所公開招聘面試答辯PPT課件
評論
0/150
提交評論