Effacer les filtres
Effacer les filtres

Optical flow between two frames

3 vues (au cours des 30 derniers jours)
Dalia
Dalia le 15 Sep 2023
Commenté : Image Analyst le 16 Sep 2023
I have used the following code to estimate a velocity of a moving box, u and v values of different points at the same block are not close. How can I estimate the representive u & v values?
obj = VideoReader('bigbox.mp4');
for k = 1 : 2
this_frame = readFrame(obj);
thisfig = figure();
thisax = axes('Parent', thisfig);
image(this_frame, 'Parent', thisax);
title(thisax, sprintf('Frame #%d', k));
end
%% optical flow
I1=imread('Framep#1.png');
I2=imread('Framep#2.png');
modelname = 'ex_blkopticalflow.slx';
open_system(modelname)
out = sim(modelname);
Vx = real(out.simout);
Vy = imag(out.simout);
img = out.simout1;
flow = opticalFlow(Vx,Vy);
figure
imshow(img)
hold on
plot(flow,'DecimationFactor',[5 5],'ScaleFactor',40);
  1 commentaire
Image Analyst
Image Analyst le 16 Sep 2023
If you have any more questions, then attach your data ('bigbox.mp4') with the paperclip icon after you read this:

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Computer Vision with Simulink dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by