Reading a video in MATLAB and plotting the trajectory of robot in each frame

1 Ansicht (letzte 30 Tage)
Hello all,
I am working on a path planning task where I am trying to plot the trajectory of a robot arm in the SimMechanics explorer, but unfortunately this feature is not yet available.
I am now trying to find an alternative to this where I have saved the video of the SimMechanics animation as a video and read that video in MATLAB.
Is it possible to draw the trajectory on each frame of that video?
Any other suggestions to trace the trajectory will also be valuable.
Thanks and Regards

Antworten (1)

Abhisek Pradhan
Abhisek Pradhan am 9 Aug. 2019
A possible work around would be to get frames of the video using VideoReader Object and reading the Video.
v = VideoReader('filename');
while hasFrame(v)
video = readFrame(v);
end
whos video
Now from each frame, we can get the position of robot’s arm using Computer Vision Toolbox taking image of robot’s arms as reference image and plot the trajectory of robot in each frame.
The following link shows an example to find the position of an object from a reference object.

Kategorien

Mehr zu Simulation and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by