Code covered by the BSD License  

Highlights from
Avi2Matrix

Be the first to rate this file! 11 Downloads (last 30 days) File Size: 1.21 KB File ID: #37615
image thumbnail

Avi2Matrix

by

 

24 Jul 2012 (Updated )

the images contained in the avi file are placed in 3D matrix , ( type [double]).

| Watch this File

File Information
Description

This function converts the avi file ( Audio/Video interleaved) into 3D matrix M(n,p,q) called Voxel or image sequence for numerical processing , with :
n: pixels along the x axis.
p: pixels along the y axis.
q : pixels along the time axis .

two internal functions used : avifino & aviread .

Screenshot source : Mehmet K "Adaptive Motion-Compensated Filtering of Noisy Image Sequences" IEEE transactions on circuits and system for video technology (1993).

For video Files with "TrueColor" Imagetype use this code instead :
%function Y=Avi2Matrix( filename )
%
%info=aviinfo(filename);
%width=info.Width;
%height=info.Height;
%nframes=info.NumFrames;
%Y=uint8(zeros(height,width,3,nframes));

%video=aviread(filename);

%for i=1:nframes
% Y(:,:,:,i)=video(i).cdata;
%end
%Y=im2double(Y);

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
24 Jul 2012 Youssef KHMOU

the reverse process 3dMatrix==>avifile can be found in the following page :

http://www.mathworks.com/matlabcentral/fileexchange/3052-matrix2avi

Updates
01 Aug 2012

Code improvement for reading video Files of TrueColor ImageType.

Contact us