getframe has extra row and column

I am trying to build an avi movie that is the exact magnification and quality of the original frames. I am using the following code, but M has frames that are 129x129, it is supposed to be 128x128. There is an extra row and column filled with the value 240. I have to manually "delete" the extra row and column using the block of code clearly self explanatory afterwards assigning only the 128x128 portion. What causes the extra row and column in M?:
for j=1:L1+L2
imshow(data3(:,:,j),v,'InitialMagnification',100)
colormap(gray)
M(j) = getframe;
end
for p=1:length(M)
all_frame(p).cdata(1:128,1:128,1:3)=M(p).cdata(1:128,1:128,1:3);
all_frame(p).colormap=M(p).colormap;
end
myVideo = VideoWriter('movie.avi','Uncompressed AVI');
open(myVideo);
writeVideo(myVideo, all_frame);
close(myVideo);
end

4 Kommentare

Doug Hull
Doug Hull am 24 Okt. 2012
What makes you believe getframe is "supposed to be 128x128"? I see nothing in the code that tells me that M should be any specific size.
Rafael J.
Rafael J. am 5 Nov. 2012
data3 is 128x128x(L1+L2) so imshow(data3(:,:,j),v,'InitialMagnification',100) results in a 128x128 image, however after I do M(j)=getframe; the frame is 129x129, so somewhere it is adding an extra horizontal and vertical line.
Adrin
Adrin am 22 Jan. 2014
Hello,
Did you find any solution for this problem ?
Thank you in advance,
Rafael J.
Rafael J. am 15 Feb. 2017
Hi Adrin,
Delayed response, but no I never found the solution to the problem.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Gefragt:

am 24 Okt. 2012

Kommentiert:

am 15 Feb. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by