简体   繁体   中英

Extract trajectory/ground truth from video

Is there a software/toolbox in which I can extract the mobile robot trajectory from video recordings? My algorithm uses mobile robot to track a U-shaped trajectory, and I would like to mark/extract that trajectory from video. I used a stationary camera observing the robot motion in indoor environment. I would prefer if there is a Matlab toolbox available, but any help is very appreciated.

In r2012b, use a VideoReader to iterate through the movie, one frame at a time. For older versions of Matlab, use the aviread() function.

For each frame, call ginput() to collect graphical input from the user.

myVideo = VideoReader('myRobotVideo.avi');
n = myVideo.NumberOfFrames;
x = nan(n,1);
y = nan(n,1);
for i = 1:n
  img = read(myVideo,i);
  imshow(img);
  [x(i),y(i)] = ginput();
end
disp([x,y])

This is a convenient technique for quickly annotating computer vision ground truth.

Alternatively, if you don't have the toolbox, you can use an open source tool such as FFMPEG to convert the video as a series of .png images, and then iterate through these using the built-in imread() function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM