필터 지우기
필터 지우기

Continual points on a movie

조회 수: 2 (최근 30일)
Jake Elliott
Jake Elliott 2020년 4월 21일
답변: Bjorn Gustavsson 2020년 4월 21일
I have a movie made of a plot with images behind each frame and points that mark certain locations via plots. I want to have the points from previous frames showing on the current frame as if showing a "path" per se. I have made the movie using the imshow, hold on, plot(), and get frame functions in a for loop. What would be the best way to accomplish this? Thank you.
  댓글 수: 4
Jake Elliott
Jake Elliott 2020년 4월 21일
Here is my for loop. I would like all past points to be added to the current frame with the new data
darova
darova 2020년 4월 21일
If you want to write a movie use VideoWriter

댓글을 달려면 로그인하십시오.

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2020년 4월 21일
If you want to plot all the points (x,y) from the first to point i you can do something like this:
q = 1;
for i1 = 1:numimgs % Avoid using i and j as indices, they are also used for (-1)^(1/2)
imshow(I{i1})
hold on
plot(x(1:i1),y(1:i1),'b.')
fishplot(i1) = plot(x(i1,:),y(i1,:),'r.')
hold off
P(q) = getframe;
q = q+1;
end
Maybe that is what you want to achieve.
HTH

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by