I am trying to read an AVI file into Matlab but am having a problem with the frames being sheared. I am using the Matlab code from Mathworks for VideoReader with only a few minor modifications.
xyloObj = VideoReader('video.avi');
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(xyloObj, k);
end
imagesc(mov(1).cdata)
colormap gray
Below is a single frame from the video. Has anyone encountered this before? The video was produced by a PI Connect infrared camera. The video shows no shearing when played in VLC. I know I can correct the shearing with a simple image processing operation, but I'd rather just avoid the problem altogether. Thanks in advance.