Help me to understand function interp2
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Read, Write, and Modify Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!