Help me to understand function interp2
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Read, Write, and Modify Image dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!