video processing problem
- From: "Bob " <boriskagt@xxxxxxxxx>
- Date: Thu, 7 Jun 2012 12:02:12 +0000 (UTC)
Hello
Recently i start to learning video processing.
I wrote a simple code that convert video file from "RGB" to "Grayscale",
but when i trying to Play converted file by using "implay" i get errors.
I hope someone can guide me to solve the errors
I use MATLAB 2008b
The Class of the video file is : uint8
Code:
-------------------------------------------------------------------------------------
clc
clear
close all
rgb = 3;
gray = 1;
my_video = mmreader('CIMG1232.avi');
frameRate = get(my_video,'FrameRate');
nframes = get(my_video, 'NumberOfFrames');
I = read(my_video, 1);
video_p = zeros([size(I,1) size(I,2) gray nframes], class(I));
for i = 1 : nframes
singleFrame = rgb2gray(read(my_video, i));
video_p(:,:,:,i) = singleFrame;
end;
implay(video_p, frameRate);
----------------------------------------------------------------------------------------
Thanks in advance
.
- Prev by Date: Re: Splitting an array
- Next by Date: Re: determinant
- Previous by thread: determinant
- Next by thread: Re: Excel writing; next empty cell
- Index(es):