How to add multiple points to Track in a video?

6 views (last 30 days)
cha bha
cha bha on 27 May 2018
Commented: Abed Ahmad on 12 Mar 2021
I have few points track on exercise video,Currently i able to add one point to the video manually,I need to know how to add more points to this video by manually?
if true
videoFileReader = vision.VideoFileReader('deadlift.mp4');
videoPlayer = vision.VideoPlayer('Position',[1,10,1280,720]);
objectFrame = videoFileReader();
% objectRegion = [264,122,93,93];
%
figure;
imshow(objectFrame);
[neck_X,neck_Y]= ginput(1);
imshow(pointImage);
% points = detectMinEigenFeatures(rgb2gray(objectFrame));
pointImage1 = insertMarker(objectFrame, [neck_X,neck_Y],'+','Color','white');
figure;
imshow(pointImage);
title('Detected interest points');
tracker = vision.PointTracker('MaxBidirectionalError',1);
initialize(tracker,[neck_X,neck_Y],objectFrame);
while ~isDone(videoFileReader)
frame = videoFileReader();
[points,validity] = tracker(frame);
out = insertMarker(frame,points(validity, :),'+');
videoPlayer(out);
disp(points);
end
end
I get a point like below
  1 Comment
Abed Ahmad
Abed Ahmad on 12 Mar 2021
Hello cha bha,
i don't know if you got your solution to your question but in case not:
Just add it to the ginput function in like:
[hip_X, hip_Y] = ginput(1);
[shoulder_X,shoulder_Y] = ginput(1);
But have in mind, that you have to initialize your "trackpoints" in the initialize function. Therefore define a Marker Position Matrix in order you like the most M_Position = [m1x m2y; m2x m2y; m3x m3y]
initialize(tracker,M_Position, objectFrame);

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!