필터 지우기
필터 지우기

Animation of image

조회 수: 64 (최근 30일)
John
John 2011년 6월 13일
댓글: Image Analyst 2017년 11월 2일
Hello, I need some help. I have a project to create animation of an image mooving by some points of two arrays X and Y. This two arrays define some curve. I can put the background image and another one on top of it. But I can't think of a way to animate it. I tried every think I could think of but nothing is satisfactory ednouth. Can some one help me. If you require some code I could provide you. Thank you in advance!

채택된 답변

David Young
David Young 2011년 6월 14일
Here's something simple that works - though it's not elegant or efficient:
% image data
bigIm = imread('street1.jpg');
smallysize = 50;
smallxsize = 70;
smallIm = bigIm(188:188+smallysize-1, 177:177+smallxsize-1, :);
% trajectory data
trajy = 400:-5:100;
trajx = trajy;
% animated display
for step = 1:length(trajx)
displayIm = bigIm;
displayIm(trajy(step):trajy(step)+smallysize-1, ...
trajx(step):trajx(step)+smallxsize-1, :) = smallIm;
imshow(displayIm);
pause(0.2);
end
  댓글 수: 2
subjoy sahu
subjoy sahu 2017년 11월 2일
How to save this file. I am trying but it came as a figure..plzz help
Image Analyst
Image Analyst 2017년 11월 2일
Call getimage() to extract the image out of the axes on the figure.

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

추가 답변 (3개)

Arnaud Miege
Arnaud Miege 2011년 6월 13일
Have a look at the Animation section of the MATLAB documentation.
HTH,
Arnaud

Image Analyst
Image Analyst 2011년 6월 13일

John
John 2011년 6월 13일
Well, thank you. I have read this documents. But they are not what I need. I mean I can't make my object to move in the axis to create the animation and this is the problem.I have one image over a background image and I need to moove it by specific coordinates. This is what I can't do. I tried to put the top image in new axis and to move this new axis. Not any luck... Any ideas how I can move my top image over the background?
  댓글 수: 2
Arnaud Miege
Arnaud Miege 2011년 6월 14일
Can you post your code?
Jonas Reber
Jonas Reber 2011년 6월 15일
yes - could you provide some code, then its much easier to help.

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

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by