How to add multiple points to Track in a video?
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
Abed Ahmad
2021-3-12
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);
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Tracking and Motion Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!