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

12 ビュー (過去 30 日間)
Gautami Golani
Gautami Golani 2019 年 8 月 5 日
回答済み: Abhisek Pradhan 2019 年 8 月 9 日
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

回答 (1 件)

Abhisek Pradhan
Abhisek Pradhan 2019 年 8 月 9 日
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.

Community Treasure Hunt

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

Start Hunting!

Translated by