Y-Label upside down on on videoreader
Show older comments
Hello!
So, I have a video I'm reading frame by frame. I need to acquire some data from it using ginput, so I need the axis to be right.
My code is:
mov = VideoReader('pendulo.mp4'); % estrutura com video
nFrames = mov.NumFrames; % numero de frames
framerate = mov.FrameRate; % numero de frames por segundo
dtframes=1/framerate; %tempo entre frames
i=1; t=0; tf=nFrames*dtframes; dt=10*dtframes;
if ~exist('dados.mat','file')
while (t <= tf)
mov.CurrentTime=t; frame=readFrame(mov); image(frame); drawnow
tv(i)=t; t=t+dt; title(strcat('Frame ', num2str(i)));
if i>1
hold on;
plot(x,y,'ro');
end
[x(i), y(i)]=ginput(1);
i=i+1;
end
I don't understand why the label is upside down... thanks!
Accepted Answer
More Answers (1)
Sulaymon Eshkabilov
on 20 Jun 2021
0 votes
The cause can be explained with data import and record them into MATLAB workspace. You may consider using flip() to correct the orientation then.
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!