How to plot bounding boxes for a person in a video frame?
Show older comments
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)
Chad Greene
on 3 Apr 2016
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)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!