Help me to understand function interp2
显示 更早的评论
Can anyone help me understand the interp2 function well?
I need to reconstruct a video given optical flow vectors. I did it in the following way:
while hasFrame(video)
frameRGB = readFrame(video);
frameGray = im2gray(frameRGB);
flow = estimateFlow(of,frameGray);
[x, y] = meshgrid(1:size(frameGray,2), 1:size(frameGray,1));
Vx = flow.Vx; %optical flow vector
Vy = flow.Vy;
frame_double = im2double(frameGray);
o=o+1;
frame_predicted = interp2(frame_double, x-Vx, y-Vy, 'linear', 0);
if o>1
frame_previous_real=frame_double;
elseif o==1
frame_previous_real=frame_double;
end
end
Is it correct to consider the current frame to calculate the predicted frame?
And what will come out of inter2 is the next predicted frame and so on throughout the cycle?
Thank you very much to those who will answer me
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!