How to plot bounding boxes for a person in a video frame?

I have managed to read in a video file frame by frame. I have also read in the csv file as can be seen above. Each record of the csv file contains values that tag each person in the video, the number of the frame and the box coordinates of the body of the person.
I would like to plot the body bounding boxes for each person in each video frame, overlaid atop the video data. How would i plot this data?
infile = ['baseballField.avi'];
readerobj=VideoReader(infile);
groundtruth = csvread('baseballField-groundtruth.top');
for i=1:2:20
vidframe=read(readerobj,i);
imshow(vidframe);
drawnow
end

Answers (1)

If you have the bounding box coordinates in terms of rows and columns of pixels, you can simply use plot to plot the bounding box:
plot(cols,rows)

Products

Asked:

on 3 Apr 2016

Answered:

on 3 Apr 2016

Community Treasure Hunt

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

Start Hunting!