Use getframe and movie, but get truncated movie...

1 view (last 30 days)
  • Hi, I have a problem using imshow + getframe + movie.
  • My purpose is to put a square onto each white beads in the image, and assign a number to each bead.
  • The Code, basically, use a loop to make every frame (512x512x3).And then use imshow+getframe to make a single frame. After the loop, put all frames together using command, movie.
  • The problem is: I can see that images are 512x512 during the loop, but images get truncated (few beads lost in the upper part) in the final movie.
  • Below is the link to the images: https://picasaweb.google.com/113057351208105452923/PublicPictures
  • And here is the code (simplified):
F=moviein(n_frames);
for i = 1:n_frames
% Here is the function to find bead position...
and give the blue, square frame
[rc, row, col, singleImage]=positionWeighting(A,rc,i,nBeads,row,col,R);
%
imshow(singleImage);
for j=1:length(nBeads)
text(col(j), row(j), num2str(j),...
'Color',[1,0,0], 'FontSize', 20, 'HorizontalAlignment', 'left')
end
F(i)=getframe
end
movie(F)
  • Thanks for your time, read through my question and answer.
  • By the way, I also wonder if there's some method can accelerate the process. I used imshow in every loop, and it should be very inefficient this way...

Answers (0)

Categories

Find more on Display Image 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!