Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top