Code covered by the BSD License
-
costFuncMAD(currentBlk,refBlk...
Computes the Mean Absolute Difference (MAD) for the given two blocks
-
imgPSNR(imgP, imgComp, n)
Computes motion compensated image's PSNR
-
minCost(costs)
Finds the indices of the cell that holds the minimum cost
-
motionComp(imgI, motionVect, ...
Computes motion compensated image using the given motion vectors
-
motionEst4SS(imgP, imgI, mbSi...
Computes motion vectors using Four Step Search method
-
motionEstARPS(imgP, imgI, mbS...
Computes motion vectors using Adaptive Rood Pattern Search method
-
motionEstDS(imgP, imgI, mbSiz...
Computes motion vectors using Diamond Search method
-
motionEstES(imgP, imgI, mbSiz...
Computes motion vectors using exhaustive search method
-
motionEstNTSS(imgP, imgI, mbS...
Computes motion vectors using *NEW* Three Step Search method
-
motionEstSESTSS(imgP, imgI, m...
Computes motion vectors using Simple and Efficient TSS method
-
motionEstTSS(imgP, imgI, mbSi...
Computes motion vectors using Three Step Search method
-
motionEstAnalysis.m
-
View all files
from
Block Matching Algorithms for Motion Estimation
by Aroh Barjatya
Review of various block matching algorithms used for motion estimation in MPEG coding.
|
| motionComp(imgI, motionVect, mbSize) |
% Computes motion compensated image using the given motion vectors
%
% Input
% imgI : The reference image
% motionVect : The motion vectors
% mbSize : Size of the macroblock
%
% Ouput
% imgComp : The motion compensated image
%
% Written by Aroh Barjatya
function imgComp = motionComp(imgI, motionVect, mbSize)
[row col] = size(imgI);
% we start off from the top left of the image
% we will walk in steps of mbSize
% for every marcoblock that we look at we will read the motion vector
% and put that macroblock from refernce image in the compensated image
mbCount = 1;
for i = 1:mbSize:row-mbSize+1
for j = 1:mbSize:col-mbSize+1
% dy is row(vertical) index
% dx is col(horizontal) index
% this means we are scanning in order
dy = motionVect(1,mbCount);
dx = motionVect(2,mbCount);
refBlkVer = i + dy;
refBlkHor = j + dx;
imageComp(i:i+mbSize-1,j:j+mbSize-1) = imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1);
mbCount = mbCount + 1;
end
end
imgComp = imageComp;
|
|
Contact us at files@mathworks.com